nginx auth_basic uwsgi 目录简易认证。

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模块做简易权限认证。
针对目录。

 

posted on 2015-05-26 00:06  jsingsunck  阅读(289)  评论(0)    收藏  举报

导航