最近万事屋运行缓慢,时不时的负载飙升给我一发403显示。
查看都是一些无用的爬虫蜘蛛,SEO一点好处都不给我,还给万事屋增加额外负担,甚至比cc和dd都频繁,这怎么受的了,屏蔽!
1、robots屏蔽大法:
User-agent: MJ12bot
Disallow: /
User-agent:DotBot
Disallow: /
User-agent:BLEXBot
Disallow: /
User-agent:PetalBot
Disallow: /
User-agent:DataForSeoBot
Disallow: /
2、Nginx规则屏蔽:
if ($http_user_agent ~* (MJ12bot|DotBot|BLEXBot|PetalBot|DataForSeoBot) )
{
return 403;
}
3、Nginx规则屏蔽合集:
if ($http_user_agent ~* (YandexBot|spbot|DnyzBot|Researchscan|semrushbot|yahoo|AhrefsBot|DotBot|Uptimebot|MJ12bot|MegaIndex.ru|ZoominfoBot|Mail.Ru|SeznamBot|BLEXBot|ExtLinksBot|aiHitBot|Barkrowler)){
return 403;
}
这个只能对守规矩的蜘蛛,对于不守规则的,之后介绍别的办法。
没有回复内容