考虑到Pingdom是一个声誉很高的站点,我尝试订阅他们的正常运行时间监控服务。然而,即使我设置了5分钟的间隔,他们的bot Pingdom.com_bot_version_1.4并不是每秒钟访问我的站点一次,而是每秒钟访问数十次!每分钟就有成千上万的人进入!
然后,我试图完全取消服务,但仍然受到他们的机器人轰炸。我试图阻止robots.txt,但显然他们把它堵住了。接下来,我尝试使用以下命令在nginx.conf中阻止:
if ($http_user_agent ~* Pingdom.com_bot) {
return 403;
}它可以工作,但我在access.log中看到了很多503个错误。怎么才能不登录这个机器人呢?真的很烦人。我曾为他们的服务感到遗憾。
发布于 2014-08-12 18:33:31
这里有一个post 关于阻塞w00tw00t,您可以很容易地采用它。
对于你来说,最容易适应的选择就是支持fail2ban。
对403错误使用fail触发。
所以就像
[Definition]
failregex = ^<HOST> .* "(GET|POST|HEAD).*HTTP.*" 403 [0-9]{1,} ".+" ".+"$
ignoreregex=in /etc/etc 2ban/filter.d/nginx-pindotban.conf
和
[pingdotban]
enabled = true
port = http,https
filter = nginx-pingdotban
logpath = /path/to/nginx/access.log
maxretry = 5
bantime = 360000in /etc/fail2ban/jail.conf
您可以用
fail2ban-regex logfile /etc/fail2ban/filter.d/nging-pingdotban.conf同样,iptable变体也可以与以下内容一起使用
iptables -A INPUT -p tcp --dport 80 -m string --algo bm --string "the useragent" -j DROPhttps://stackoverflow.com/questions/25271523
复制相似问题