nginx auth_basic uwsgi 目录简易认证。

时间:2015-05-26 01:30:57   收藏:0   阅读:293
mkdir /etc/nginx/conf.d/auth_pwd
touch /etc/nginx/conf.d/auth_pwd/xx.pwd

htpasswd -c -d /etc/nginx/conf.d/auth_pwd/xx.pwd username
enter password

nginx conf

location / {
    uwsgi_pass 127.0.0.1:8002;
    include uwsgi_params;
}

location /admincp/ {
    auth_basic ‘password please.‘;
    auth_basic_user_file ‘conf.d/auth_pwd/hezi.pwd‘;
    uwsgi_pass 127.0.0.1:8002;
    include uwsgi_params;
}

有的时候写个简单的程序,不想写后台验证,利用nginx 的auth_basic模块做简易权限认证。
针对目录。

 

原文:http://www.cnblogs.com/jsingsunck/p/4529430.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!