nginx防止部分DDOS攻击
策略: 1)利用 ngx_http_limit_req_module模块限制请求的速率和请求连接数 配置参照: http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_zone 2)利用 ngx_http_limit_conn_module模块限制并发数 配置参照: http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#directives 3)更多策略参考官方文档 http://nginx.org/en/docs/ 给出配置如下: http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; limit_conn_zone $binary_remote_addr zone=addr:10m; server { listen 80; server_name 210.10.5.102; location / { root html; index index.html index.htm; limit_req zone=one burst=5; limit_conn addr 1; } } } 其它的配置都省略,这里只讨论关注为了防DDOS的设限点,