首页 > 其他 > 详细

nginx deny 封IP

时间:2019-12-06 20:18:32      阅读:180      评论:0      收藏:0      [点我收藏+]

官方文档地址:http://nginx.org/en/docs/http/ngx_http_access_module.html#deny

Syntax: deny address | CIDR | unix: | all;
Default: —
Context: http, server, location, limit_except
1
2
3
配置在server上下文

Context: server

server {

server_name test.example.com;

...

deny 1.1.1.1;

deny 2.0.0.0/8;

}
1
2
3
4
5
6
7
8
9
10
11
配置在location上下文

Context: location

location ^~ /test/ {
deny 1.1.1.1;
deny 2.2.2.2;
deny 3.3.3.3;
deny 8.0.0.0/8;

...

}

nginx deny 封IP

原文:https://www.cnblogs.com/ExMan/p/11997073.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!