xzf158
6/22/2016 - 12:52 AM

nginx配置htpasswd方法.md

如果没有安装 httpd

yum -y install httpd 

添加用户

htpasswd -c /Data/app/nginx/conf/htpasswd_new mzw

输入两次密码

添加到nginx里

location / {
    auth_basic           "Internal Version";
    auth_basic_user_file  /Data/app/nginx/conf/htpasswd_new;
    if ($arg_act) {
        proxy_pass http://qa.maizhi.com;
        break;
    }
    try_files $uri $uri/ /index.php?$query_string;
}