Fail2ban

Revision as of 08:16, 19 September 2024 by Mhan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Create a new jail named httpd

/etc/fail2ban/filter.d/httpd-ban.conf:

[Definition]
failregex = ^<HOST> .*
ignoreregex =


/etc/fail2ban/jail.d/cutomisation.local:

[httpd]
enabled = true
filter = httpd-ban
port = http,https
logpath = %(nginx_error_log)s


Ban an IP from accessing any of the websites

$ sudo fail2ban-client set httpd banip 81.19.140.244