【发布时间】:2014-02-22 15:06:27
【问题描述】:
出于某种原因,某种脚本每秒向我的网站发出重复请求,或者更快地向不存在的 URL 发出请求。这很痛苦,因为它阻塞了日志(并且是不必要的(尽管很小)资源消耗)。只是想知道对于托管在 Heroku 上的网站是否有一个很好的方法来处理这个问题。请求每次都来自不同的 IP 地址。
编辑:请注意,请求总是指向完全相同的 URL。
这是一个示例,它每隔一秒左右重复一次,除了来自不同的 IP:
Feb 22 08:37:28 myApp app/web.1: ActionController::RoutingError (Not Found):
Feb 22 08:37:28 myApp app/web.1: app/controllers/application_controller.rb:31:in `not_found'
Feb 22 08:37:28 myApp app/web.1: app/controllers/my_controller.rb:141:in `my_method'
Feb 22 08:37:28 myApp app/web.1: [Exceptiontrap] Raised Exceptiontrap::Rack::Exception
Feb 22 08:37:28 myApp app/web.1: [Exceptiontrap] Catched Exception: ActionController::RoutingError
Feb 22 08:37:28 myApp app/web.1: Started GET "/aSpecificURL" for 109.242.56.44 at 2014-02-22 13:37:28 +0000
Feb 22 08:37:28 myApp heroku/router: at=info method=GET path=/aSpecificURL host=www.myApp.com request_id=9caeabcf-adcc-417f-940d-0458a81d9c32 fwd="109.242.56.44" dyno=web.1 connect=2ms service=24ms status=404 bytes=1632
【问题讨论】:
标签: ruby-on-rails security heroku sysadmin