Report this

What is the reason for this report?

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

Posted on July 1, 2016

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 : https://www.knthost.com/nginx/blocking-bots-nginx , 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 ?

Lex



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!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.