数字化技能提升教程,数字化时代生存宝典

数字化百科 / 词条 / Nginx身份验证

Nginx身份验证

查看全部词条命名空间:Main

Nginx status做身份验证:
#cd /usr/local/nginx/conf
#mkdir htpasswd
/usr/local/apache2/bin/htpasswd -c /usr/local/nginx/conf/htpasswd/zhang zhang #添加用户名为zhang
New password: (此处输入你的密码)
Re-type new password: (再次输入你的密码)
Adding password for user
配置nginx
location ~ ^/(zhang)/ {
root /htdocs/count;
auth_basic "LT-COUNT-TongJi";
auth_basic_user_file /usr/local/nginx/conf/htpasswd/zhang;
}
看看打开页面是否需要输入用户名和密码!

相关条目

参考来源

参考来源

category:Nginx