Skip to content

Instantly share code, notes, and snippets.

@rooty
Forked from AysadKozanoglu/jail.conf
Created June 16, 2020 11:33
Show Gist options
  • Save rooty/006ab37153af4c6cecd41e2182af4be1 to your computer and use it in GitHub Desktop.
Save rooty/006ab37153af4c6cecd41e2182af4be1 to your computer and use it in GitHub Desktop.
fail2ban nginx 404 400 403 444 filter /etc/fail2ban/filter.d/nginx-4xx.conf enable
# to enable this filter add to jail.conf following (/etc/fail2ban/jail.conf)
# Thanks to -> TheBarret
[nginx-4xx]
enabled = true
port = http,https
logpath = /var/log/nginx/access.log
maxretry = 3
# vim /etc/fail2ban/filter.d/nginx-4xx.conf
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$
ignoreregex =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment