How to Block IP DDOS in nginx -
the ngx_http_access_module module allows limiting access client addresses.
access can limited password or result of subrequest. simultaneous limitation of access address , password controlled satisfy directive.
location / { deny 192.168.1.1; allow 192.168.1.0/24; allow 10.1.1.0/16; allow 2001:0db8::/32; deny all; }
the rules checked in sequence until first match found. in example, access allowed ipv4 networks 10.1.1.0/16 , 192.168.1.0/24 excluding address 192.168.1.1, , ipv6 network 2001:0db8::/32. in case of lot of rules, use of ngx_http_geo_module module variables preferable.
source: http://nginx.org/en/docs/http/ngx_http_access_module.html
Comments
Post a Comment