我剛剛向生產服務器推出了我的第一個Rails 3.2.6應用程序。當有人進入主頁時,這是由我的IndexController處理的,並且根據登錄用戶的類型,它可能會將其發送到另一個URL。生產Rails應用程序 - 奇怪的重定向到外部網站
什麼我稍微簡化的代碼示例是這樣的:
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地址。這是我應該擔心的事嗎?任何有關幫助我理解這裏發生的情況的信息都將非常感謝。
查看下面的日誌摘錄,在「重定向到」網址中,域名從我的網站變爲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)
謝謝,我使用Passenger,但我會看看如何爲我的應用程序做這件事,並在本週末進行測試。我會讓你知道我怎麼走。 – Planty 2012-08-11 03:04:23