Once you have your MTA set up, you will have to adjust some additional settings within the [DEFAULT] section of the /etc/fail2ban/jail.local file. Comment or remove this line, then restart apache, and mod_cloudflare should be gone. If you set up email notifications, you should see messages regarding the ban in the email account you provided. To y'all looking to use fail2ban with your nginx-proxy-manager in docker here's a tip: In your jail.local file under where the section (jail) for nginx-http-auth is you need to add this line so when something is banned it routes through iptables correctly with docker: Anyone who has a guide how to implement this by myself in the image? Would also love to see fail2ban, or in the meantime, if anyone has been able to get it working manually and can share their setup/script. bleepcoder.com uses publicly licensed GitHub information to provide developers around the world with solutions to their problems. To do so, you will have to first set up an MTA on your server so that it can send out email. Well, iptables is a shell command, meaning I need to find some way to send shell commands to a remote system. The number of distinct words in a sentence. Even with no previous firewall rules, you would now have a framework enabled that allows fail2ban to selectively ban clients by adding them to purpose-built chains: If you want to see the details of the bans being enforced by any one jail, it is probably easier to use the fail2ban-client again: It is important to test your fail2ban policies to ensure they block traffic as expected. If I test I get no hits. This will allow Nginx to block IPs that Fail2ban identifies from the Nginx error log file. #