0
点赞
收藏
分享

微信扫一扫

nginx 限制特定地址访问

Nginx配置文件增加

location /admin {      #访问路径
 
allow 192.168.xx.xx;    #限定访问的地址
deny all;
 
index index.html index.htm;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 30s;
}

屏蔽单个ip访问

deny 123.68.23.5;

允许单个ip

allow 123.68.25.6;
deny all; 

屏蔽所有ip

deny all; 

举报

相关推荐

0 条评论