nginx Access 封 IP

Official documents Address: http: //nginx.org/en/docs/http/ngx_http_access_module.html#deny

Syntax: the deny address | CIDR | UNIX: | All;
the Default: -
the Context: HTTP, server, LOCATION, limit_except
. 1
2
. 3
disposed context 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
arranged in the location context

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;

...

}

Guess you like

Origin www.cnblogs.com/ExMan/p/11997073.html