求助! semrushbot蜘蛛不讲武德一直爬,导致服务器卡死!

91次阅读

共计 898 个字符,预计需要花费 3 分钟才能阅读完成。

求助! semrushbot 蜘蛛不遵守规则一直爬, 服务器卡死!怎么设置没有用,一直爬。。。请教大佬们有什么办法不让 semrushbot 垃圾蜘蛛爬。跪谢!

老的贴子里看到这个大佬说最后把这蜘蛛来访设定成 301 到他自己网站去,没几分钟就消失了。(这要怎么设置啦)
https://hostloc.com/forum.php?mo … ighlight=semrushbot

这下面是我胡设置。
  #屏蔽垃圾蜘蛛
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 404;
}

robots.txt

User-agent: SemrushBot
Disallow: /
User-agent: SemrushBot/6~bl
Disallow: /
User-agent: SemrushBot/7~bl
Disallow: /

网友回复:

注册 return 301

hktv   这样吗?if ($http_user_agent ~* semrushbot){return 301 http://www.semrush.com;}

require 这样好像不行呀

hktv 有没有哪位大佬好心告诉一下,怎么弄呀,昨天弄了一天没有弄好

hktv 额,robots 规则拦不住就上防火墙咯,我用过宝塔防火墙,直接拦截 ua,你这个规则 return403 才是拒绝访问,404 是找不到文件。。。

hktv 修改完了要重启 nginx

zixi 不管是 404 还是 403,只要是请求,服务器都会产生负载。nginx 试试 444,或者利用 iptables 屏蔽

require 这不行。重启了试了,

取个什么名好呢 试了 444 也不行,我再试试你后面说的那个

注册 我用的,Nginx 免费防火墙 6.5,请教下怎么设计拉截 ua  谢谢哦

正文完
 0