Очередной обиженый дебил начал долбить сервер, впрочем, суть на сервере должен быть установлен fail2ban В конфиг nginx: Код: limit_conn_zone $binary_remote_addr zone=addr:10m; limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; Код: server { ... limit_req zone=one burst=3 nodelay; limit_conn addr 5; ... создаем два фильтра в папке /etc/fail2ban/filter.d nginx-conn-limit.conf Код: # Fail2Ban configuration file # # supports: http_limit_zone module [Definition] failregex = limiting connections by zone.*client: <HOST> # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = nginx-req-limit.conf Код: # Fail2Ban configuration file # # supports: http_limit_zone module [Definition] failregex = limiting requests.*client: <HOST> # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = включаем фильтры в конфиге /etc/fail2ban/jail.conf Код: [nginx-conn-limit] enabled = true filter = nginx-conn-limit action = iptables-multiport[name=ConnLimit, port="http,https", protocol=tcp] logpath = /var/log/nginx/error.log findtime = 300 bantime = 2400 maxretry = 100 [nginx-req-limit] enabled = false filter = nginx-req-limit action = iptables-multiport[name=ReqLimit, port="http,https", protocol=tcp] logpath = /var/log/nginx/error.log findtime = 300 bantime = 2400 maxretry = 1001 ну и перезагружаем niginx и fail2ban Код: /etc/init.d/nginx restart Код: /etc/init.d/fail2ban restart результат Код: iptables -L ссылки: http://nginx.org/ru/docs/http/ngx_http_limit_conn_module.html http://nginx.org/ru/docs/http/ngx_http_limit_req_module.html http://www.fail2ban.org/wiki/index.php/Main_Page