2012-08-10 52 views
2

我剛剛向生產服務器推出了我的第一個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) 

回答

1

我看到同樣的事情與我的Rails臨時服務器之一。我認爲問題是您需要拒絕所有不是預期域的流量。

像這樣的事情在你的nginx的設置(如果你使用nginx的):

http://nginx.org/en/docs/http/server_names.html

server { 
    listen  80 default_server; 
    server_name _; 
    return  444; 
} 

不知道這個交通的一點是什麼?嗅探網絡流量時使用別人的Rails應用程序作爲釣魚網站的一種全新方式?似乎有太多的變數可以成爲一種有效的技術。

+0

謝謝,我使用Passenger,但我會看看如何爲我的應用程序做這件事,並在本週末進行測試。我會讓你知道我怎麼走。 – Planty 2012-08-11 03:04:23

相關問題