mariusv / nginx-badbot-blocker

Block bad, possibly even malicious web crawlers (automated bots) using Nginx
858 stars 140 forks source link

please update installation guide #188

Open evemilano opened 5 years ago

evemilano commented 5 years ago

Hello, amazing tool but it takes me some try to get it working, I have to say I'm a beginner. The main guide (https://github.com/mariusv/nginx-badbot-blocker) doesn't say anything about this...

To enable it in a host file the following will go in the server block

You can use all or just pick the one's you want on a host configuration

You may also want to {return 444;} which is an Nginx feature that drops the

connection immediately without even sending headers.

Block Bad Bots

Send 403 Forbidden or 444 Drop Connection

if ($bad_bot) { return 444; }

Block Bad Referers

Send 403 Forbidden or 444 Drop Connection

if ($bad_referer) { return 403; }

if ($bad_urls1) { return 403; }

if ($bad_urls2) { return 403; }

if ($bad_urls3) { return 403; }

if ($bad_urls4) { return 403; }

if ($bad_urls5) { return 403; }

if ($bad_urls6) { return 403; }

Block Snoopers

Send 444 Connection Closed Without Response

if ($validate_client) { return 444;}

I got it after reading all the conf file. Please, add in the main guide that we have to modify also the server block, and not only the http block :)

mariusv commented 5 years ago

Heya @evemilano , great suggestion. Please do a pull request with your suggestion and will be more than happy to approve it :-)