首页 > 其他 > 详细

nginx auth_basic uwsgi 目录简易认证。

时间:2015-05-26 01:30:57      阅读:292      评论:0      收藏:0      [点我收藏+]
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模块做简易权限认证。
针对目录。

 

nginx auth_basic uwsgi 目录简易认证。

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!