nginx 基本身份验证不适用于 windows
nginx basic auth don't work on windows
这是我的nginx conf(window2003服务器)的一部分
server {
listen 80;
server_name xxx.example.com;
access_log logs/example.com.log;
location / {
auth_basic "Restricted";
auth_basic_user_file c:/xxx/password_file;
proxy_set_header Authorization "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000/xx/;
}
}
访问xxx.exmaple.com
网站提示我输入用户名和密码(正确),反复提示。
- password_file is created by
htpassword
command on Mac OS.
- http://127.0.0.1:3000/xx/ proxy for tomcat application .
- nginx version is
1.7.12
for window.
可能是带有 nginx 的 HttpBasicAuthModule 不支持 windows 平台?
它的;
auth_basic "Restricted";
auth_basic_user_file c:/xxx/password_file;
这是我的nginx conf(window2003服务器)的一部分
server {
listen 80;
server_name xxx.example.com;
access_log logs/example.com.log;
location / {
auth_basic "Restricted";
auth_basic_user_file c:/xxx/password_file;
proxy_set_header Authorization "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000/xx/;
}
}
访问xxx.exmaple.com
网站提示我输入用户名和密码(正确),反复提示。
- password_file is created by
htpassword
command on Mac OS.- http://127.0.0.1:3000/xx/ proxy for tomcat application .
- nginx version is
1.7.12
for window.
可能是带有 nginx 的 HttpBasicAuthModule 不支持 windows 平台?
它的;
auth_basic "Restricted";
auth_basic_user_file c:/xxx/password_file;