Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fail2ban nginx 404 400 403 444 filter /etc/fail2ban/filter.d/nginx-4xx.conf
# nano /etc/fail2ban/filter.d/nginx-4xx.conf
#
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$
ignoreregex =
@chovy

This comment has been minimized.

Copy link

commented Feb 25, 2019

How do we enable this?

@TheBarret

This comment has been minimized.

Copy link

commented Sep 14, 2019

How do we enable this?

Add this to your jail.conf
[nginx-4xx]
enabled = true
port = http,https
logpath = /var/log/nginx/access.log
maxretry = 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.