首页 新闻 会员 周边

nginx开启用户认证后一直需要密码

0
悬赏园豆:20 [待解决问题]

nginx开启配置用户认证之后,客户端每发送一次请求都需要密码(如静态资源文件js, css等),怎么办? 理论上应该只需要输入一次密码就可以了。怀疑是认证头丢失了。

 

nginx 配置文件如下

        location /es/ {
                rewrite ^/es/(.*)$ /$1 break;
                include proxy_params;
                proxy_pass http://localhost:9200;
                proxy_redirect http://$host/ http://$host/es/;
                auth_basic "please login";
                auth_basic_user_file /etc/openresty/nginx/passwd/docs.htpasswd;
        }

LL999的主页 LL999 | 初学一级 | 园豆:182
提问于:2015-05-26 11:12
< >
分享
所有回答(1)
0

auth_basic "please login";

auth_basic_user_file /etc/openresty/nginx/passwd/docs.htpasswd;

放在server块中行不?

河在谈 | 园豆:202 (菜鸟二级) | 2018-08-29 12:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册