Skip to content

Instantly share code, notes, and snippets.

@nitogel
Created March 28, 2019 11:20
Show Gist options
  • Save nitogel/12dbac44dad299bffb23c88f8ba9fe42 to your computer and use it in GitHub Desktop.
Save nitogel/12dbac44dad299bffb23c88f8ba9fe42 to your computer and use it in GitHub Desktop.
fail2ban nginx forbidden filter & jail
[Definition]
failregex = ^ \[error\] \d+#\d+: .* forbidden .*, client: <HOST>, .*$
ignoreregex =
[nginx-forbidden]
enabled = true
filter = nginx-forbidden-filter
port = http,https
logpath = /var/log/nginx/*error*.log
findtime = 3600
bantime = 6000
maxretry = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment