标签:
1.nginx验证可以做二次验证:
apache2-utils mini-httpd #以上2个包都带htpasswd工具 #sudo apt-get install install apache2-utils 或 mini-httpd #htpasswd -b -c /usr/local/nginx/conf/nginx_passwd kkk kkk #创建验证文件并添加用户 #htpasswd -b /usr/local/nginx/conf/nginx_passwd ppp kkk #添加验证用户
2.nginx配置:
server {
listen 80 default_server;
server_name localhost;
root /data/www/t1;
index index.php index.html index.htm;
#以下验证方式:基本验证
auth_basic "input you user name and password";
auth_basic_user_file /etc/nginx/conf.d/nginx_passwd;
#对joyuapp目录开启验证
location /joyuapp {
autoindex on;
autoindex_exact_size off;
}
3.重启nginx
标签:
原文地址:http://my.oschina.net/jk409/blog/412236