配置的一部分:
auth_basic "closed site";
auth_basic_user_file /etc/nginx/htpasswd;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ^~ /api {
auth_basic off;
}
当我请求http://myserver.com/any/url
时 - 它会提示输入http密码。没关系。
但是当我请求http://myserver.com/api/anything
时,我不想提示密码。
日志错误:
"/var/www/public/api/anything" failed (2: No such file or directory), client: 1.2.3.4
但实际上请求必须转到" /var/www/public/index.php"。为什么它没有命中index.php?