Nginx身份验证
2010-03-24 14:27:00 来源:WEB开发网核心提示:Nginx身份验证nginxstatus做身份验证: #cd /usr/local/nginx/conf #mkdir htpasswd /usr/local/apache2/bin/htpasswd -c /usr/local/nginx/conf/htpasswd/zhang zhang #添加用户名为zhang
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;
??????????????? }
看看打开页面是否需要输入用户名和密码!
[]
更多精彩
赞助商链接