Linux - Nginx how to block bad bots, Avoid multiple spider bad bots

Nginx how to block bad bots

This helps to avoid serverload because of badbots. For me normally if u have build a good dynamic sitemap then you can allow other spider or bots to crawl your entire site. But if is not then there will be issues like server load spike, wastage of Bandwidth etc.

To block bots you can add as below inside 'server { }' tag

 
 if ($http_user_agent ~ "JikeSpider|proximic|Sosospider|Baiduspider|Sogou web spider") {
  return 400;
 }

The topic on Linux - Nginx how to block bad bots is posted by - Namo

Hope you have enjoyed, Linux - Nginx how to block bad botsThanks for your time

Tech Bluff