nginx 配置页面密码

yum install -y httpd-tools
htpasswd -cb /etc/nginx/htpasswd  user pwdpwd

 

location / {
    proxy_pass http://127.0.0.1:8089;
    auth_basic "ABC";
    auth_basic_user_file /etc/nginx/htpasswd;
    autoindex on;
}

 

nginx -t

nginx -s reload

posted @ 2024-09-13 18:26  walkersss  阅读(10)  评论(0编辑  收藏  举报