0
如何使基本身份驗證排除重寫的文件?nginx重寫爲htaccess重寫
location ~ "^/blank.gif" {
auth_basic off;
}
location/{
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
如何使基本身份驗證排除重寫的文件?nginx重寫爲htaccess重寫
location ~ "^/blank.gif" {
auth_basic off;
}
location/{
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
解決!
SetEnvIf Request_URI "/blank.gif" noauth=1
RewriteEngine on
RewriteRule ^blank.gif$ count.php
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /home/admin/web/domain.com/public_html/.htpasswd
Order Deny,Allow
Satisfy any
Deny from all
Require valid-user
Allow from env=noauth