Last active
November 2, 2023 00:31
-
-
Save AysadKozanoglu/1335735272fb3b00a03bd3eea22af818 to your computer and use it in GitHub Desktop.
fail2ban nginx 404 400 403 444 filter /etc/fail2ban/filter.d/nginx-4xx.conf enable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim /etc/fail2ban/filter.d/nginx-4xx.conf | |
[Definition] | |
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$ | |
ignoreregex = | |
bglendenning
commented
Nov 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment