Use Fail2ban for banning Bots ? Or Use Nginx for refusing Bots ?

Hi all,

First of all, does anyone know if F2B is only for other purposes than protecting authentication processes ? As far as I can know from reading, it can also ban some bots (see : BadBots filter). In that case, it would also be able to ban normal ‘bad’ traffic (from the bots) …

Question 1 : Is this the case ? So, F2B is not only used in context of authentication ?

Also, I read here : , that NGINX can be used to refuse bots.

Question 2 : which method would be preferable, in a sense of maintaining server speed and / or which method is better overall ?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The primary difference here is that fail2ban in general will manage a list, using activity to add new sources to a method of blocking them (usually a firewall). The nginx method you listed utilizes a static list of things to block. If you have such a list, the nginx method may be easier on your resources but the bot traffic would still reach the nginx process. Using fail2ban may allow more flexibility and would prevent those requests from ever reaching nginx once they are recognized.