Nginx身份验证
Nginx身份验证nginxstatus做身份验证:
#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;
}
看看打开页面是否需要输入用户名和密码!
页:
[1]