Skip to content

Instantly share code, notes, and snippets.

@iamspark1e
Created December 30, 2021 11:47
Show Gist options
  • Select an option

  • Save iamspark1e/c42bb4b1a25ac0c7a03d3995c8c67c12 to your computer and use it in GitHub Desktop.

Select an option

Save iamspark1e/c42bb4b1a25ac0c7a03d3995c8c67c12 to your computer and use it in GitHub Desktop.
[nginx-not-found]
# Prevent malicious injection
enabled = true
port = http,https
filter = nginx-not-found
logpath = /var/log/nginx/*.access.log
maxretry = 20
findtime = 60
bantime = 3600
action = iptables[name=HTTP, port=http, protocol=tcp]
#ignoreip = 192.168.1.2
# vim /etc/fail2ban/filter.d/nginx-not-found.conf
[Definition]
failregex = <HOST> -.*- .*HTTP/1.* 404 .*$
ignoreregex =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment