nginx中对指定的IP不使用密码对区域外IP使用密码访问
2013-06-01 17:41
465 查看
## 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/;
}
}
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/;
}
}
相关文章推荐
- nginx中对指定的IP不使用密码对区域外IP使用密码访问
- nginx允许指定IP免密码访问页面,其他密码验证访问
- 使用nginx和iptables做访问权限控制(IP和MAC)
- python3使用代理ip访问指定网站
- nginx指定目录ip访问限制
- Nginx Http认证 实现访问网站或目录密码认证保护 | 使用 HttpAuthBasicModule 模块
- Nginx屏蔽F5心跳日志、指定IP访问日志
- Oracle 使用sqlnet.ora/trigger限制/允许某IP或IP段访问指定用户
- 【腾讯云的1001种玩法】Nginx网站使用CDN之后禁止用户真实IP访问的方法
- 使用Nginx限制同一IP的访问频率
- nginx指定目录ip访问限制
- redis学习笔记---java操作redis,使用expire模拟指定时间段内限制ip访问的次数;
- linux系统中配置Nginx 拒绝代理访问指定IP的方法
- centos下nginx仅允许指定域名访问,不可用ip访问
- nginx 用户访问添加密码;autoindex模块详解;传送client IP
- Nginx在局域网中使用ip_hash负载均衡策略,访问全部分发到同一个后台服务器
- 提防坏人:Nginx 拒绝指定IP访问
- 提防坏人:Nginx 拒绝指定IP访问
- 提防坏人:Nginx 拒绝指定IP访问