Apache basic authentication except for those Allowed

前端 未结 5 792
一个人的身影
一个人的身影 2020-12-13 19:59

Problem: I have some files under /var/www/files/ that I want them to be accessed from specific IP addresses WITHOUT requiring user/password. However, I would like that any o

5条回答
  •  不思量自难忘°
    2020-12-13 20:41

    SetEnvIF X-Forwarded-For "192.168.135.159" AllowIP
    SetEnvIF X-Forwarded-For "192.168.135.135" AllowIP
    
    AuthType Basic
    AuthName "admin"
    AuthUserFile "/var/www/domain.com/cms/.htpasswd"
    
    
    Require env AllowIP
    require valid-user
    
    

    İ also checked many variants. this code üorks with 2.4 version of apache 100%

提交回复
热议问题