我刚刚在生产服务器上启动了我的第一个 Rails 3.2.6 应用程序。当有人进入主页时,这由我的 IndexController 处理,根据登录用户的类型,它可能会将其发送到另一个 URL。
我所拥有的稍微简化的代码示例是这样的:
def index
path = new_user_session_url #default path
if current_user
path = users_admin_index_path #admin path
end
redirect_to path, :notice => flash[:notice], :alert => flash[:alert]
end
我感到困惑的是,我一直在监视日志中的问题,并且似乎重定向将针对两个 IP 地址转到巴西的随机站点。这是我应该担心的事情吗?任何有关帮助我了解这里发生的事情的信息将不胜感激。
请参阅下面的日志摘录,在“重定向到”URL 中,域正在从我的站点更改为 www.bradesco.com.br、www.bb.com.br 或 www.itau.com.br。
没有人在网站上报告任何问题,但我只是想尝试更好地理解这一点。
日志提取
Started GET "/" for 65.111.177.188 at 2012-08-10 00:20:10 -0400
Processing by Home::IndexController#index as HTML
Redirected to http://www.itau.com.br/home
Completed 302 Found in 2ms (ActiveRecord: 0.0ms)
Started GET "/" for 65.111.177.188 at 2012-08-10 00:20:10 -0400
Processing by Home::IndexController#index as HTML
Redirected to http://www.bradesco.com.br/home
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Started GET "/" for 65.111.177.188 at 2012-08-10 00:20:10 -0400
Processing by Home::IndexController#index as HTML
Redirected to http://www.bb.com.br/home
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Started GET "/" for 64.251.28.71 at 2012-08-09 22:00:20 -0400
Processing by Home::IndexController#index as HTML
Redirected to http://www.bradesco.com.br/home
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)