Block bad bots in Nginx

It’s simple to drop or block badbots like MJ12bot, AhrefsBot in Nginx without using Modsecurity. Step 1.) Create a badbot.conf in your Nginx directory. /etc/nginx/conf.d/badbot.conf Step 2.) Edit /etc/nginx/conf.d/badbot.conf and add the following content(modify highlighted part if you want to add or remove bots) map $http_user_agent $bad_bot { default 0; ~*^Lynx 0; # Let Lynx […]

Read More