WEB开发网
开发学院服务器WEB服务器Nginx nginx中对指定的IP不使用密码对区域外IP使用密码访... 阅读

nginx中对指定的IP不使用密码对区域外IP使用密码访问

 2013-06-01 21:02:51 来源:WEB开发网   
核心提示: ## example admin siteserver {server_name $HOSTNAME.dashboard.example.com;listen 80;# http://serverfault.com/questions/242218/how-to-disable-http-basic-aut

 ## example admin site
server {
server_name $HOSTNAME.dashboard.example.com;
listen 80;


# http://serverfault.com/questions/242218/how-to-disable-http-basic-auth-in-nginx-for-a-specific-ip-range
satisfy any;
allow 210.22.143.202/32;
deny all;


auth_basic "example Restricted";
auth_basic_user_file htpasswd;


error_page 404 /404;
error_page 503 /503;
#charset koi8-r;


access_log logs/dashboard.access.log;
error_log logs/dashboard.error.log;


location / {
proxy_pass http://127.0.0.1:8001;
proxy_redirect default;
proxy_set_header X-Real-IP $remote_addr;
}


location /assets {
alias $DEPLOY_ROOT_DIR/DashboardServer/assets/;
}
}

Tags:nginx 指定 IP

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接