How to block spammers from accessing your site?

Is there a script that can prevent spammers from accessing your site? like auto check ip on Project Honey Pot, Stop Forum Spam and Spamhaus to see if it’s listed then block user before they can even access the site

get something like https://github.com/mariusv/nginx-badbot-blocker

go to /etc/nginx

then sudo git clone https://github.com/mariusv/nginx-badbot-blocker.git

include the following in your nginx.conf:

include /etc/nginx/nginx-badbod-blocker/blacklist.conf;
include /etc/nginx/nginx-badbod-blocker/blockips.conf;

create a crontab to update it every day sudo crontab -e add this in it

00 00 * * * cd /etc/nginx/nginx-badbot-blocker/ && git pull > /dev/null && service nginx reload > /dev/null

And you should be good :slight_smile:

Note: replace “/etc/nginx/nginx-badbod-blocker/” with whatever folder gets created in your /etc/nginx after the git clone

1 Like