赞
踩
yum -y install httpd-tools
htpasswd -c pass.db mingzhen53 //wang 并输入密码
在次添加用户时输入时输入
htpasswd pass.db username
会在/etx/nginx/passwd.db文件中生成用户名和加密的密码:myuser:YlmaHlkJnzhxG
增加 authbasic 和 authbasicuserfile
vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name local.server.com;
auth_basic "User Authentication";
auth_basic_user_file /etc/nginx/pass.db;
location / {
root /data/www;
index index.html;
}
}
nginx -s reload
登录页面的时候就会显示输入用户名密码
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。