2010-12-07 61 views
0

在生產中部署我的導軌3應用後,我注意到路徑並不總是顯示在瀏覽器窗口中。例如,登錄或my_profile鏈接仍然只會顯示http://my_app.com而不是預期的http://my_app.com/loginhttp://my_app.com/my_profile。意見確實發生了變化,並且起作用。我還可以看到數據庫被擊中並從日誌中顯示視圖(這導致我相信這不是一個簡單的瀏覽器緩存問題)。然而直接去http://my_app.com/login工作,然而,使用應用程序中的鏈接將我帶到預期的地方,同時顯示登錄網址。我在幾個瀏覽器(firefox,opera和chrome)中嘗試了它,並得到了相同的行爲。該應用程序部署在nginx +乘客和後來的nginx +瘦集羣下。我的問題是,發生了什麼事?它可能是nginx設置或我的生產環境設置?我不知道從哪裏開始。在瀏覽器中未顯示導軌路徑(有時)

Running curl -v my_app。與節目

* About to connect() to my_app.com port 80 (#0)
* Trying xx.xx.xx.xx... connected
* Connected to my_app.com (xx.xx.xx.xx) port 80 (#0)
> GET/HTTP/1.1
> User-Agent: curl/7.21.1 (x86_64-apple-darwin10.4.0) libcurl/7.21.1 OpenSSL/1.0.0azlib/1.2.5 libidn/1.19
> Host: my_app.com
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Set-Cookie: ARPT=PKKIKIS10.0.81.64CKILJ; path=/
< Content-Type: text/html; charset=utf-8
< Status: 200
< X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.5
< ETag: "fce6dec3543058bec16175466020a906"
< X-Runtime: 7
< Content-Length: 787
< Cache-Control: private, max-age=0, must-revalidate
< Server: nginx/0.7.62 + Phusion Passenger 2.2.4 (mod_rails/mod_rack)
< P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
< X-Cache: MISS from server.com
< Via: 1.0 server.com:8080
< Connection: close
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>http://my_app.com/</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="generator" content="Hover Redirect Service">
</head>
<frameset framespacing="0" rows="100%,*" cols="100%" frameborder="no" border="0">
<frame name="DDIRECTXYZZY2" scrolling="auto" src="http://xxx.xx.xxx.xxx" noresize>
<frame name="DDIRECTXYZZY" scrolling="no" noresize>
<noframes>
<h1><a href="http://xxx.xx.xxx.xxx">http://my_app.com/</a></h1>
<p>Please <a href="http://xxx.xx.xxx.xxx">click here</a> to view the non-framed versi on.</p>
</noframes>
</frameset>
</html>

所以顯然這是一個問題。整個事情都被DNS重定向框起來了?該設置不是Phusion Passenger + nginx。它最初是,但現在它的瘦+ nginx。另外,當直接進入應用程序的IP地址,事情就很好。當我轉到域名時,我會看到框架版本。也只是IP地址標準的外觀(如它的加載整個頁面)的curl -v響應。

+0

(非)格式的問題在眼睛上太痛苦了。 – Zabba 2010-12-07 08:12:11

+1

`curl -v http:// my_app.com`返回什麼? – DanSingerman 2010-12-07 12:30:17

回答

1

的問題是幾乎可以肯定你的幀。內部框架正在加載正確的內容,但由於您(可能)並未針對鏈接中的「頂部」(或任何內容),因此瀏覽器仍會顯示最外框的網址。

瞄準框:http://www.w3.org/TR/html4/present/frames.html#h-16.3

如果你不希望看到在你的響應幀都那麼很有可能他們是一個粗製濫造的「DNS」服務的責任。獲取一個真正的DNS地址指向你的服務器,你會唱歌。

0

你有沒有嘗試使用其他客戶端計算機向你的測試?如果我按照你的解釋,這是你沒有調查過的一個選項。

你能也許向我們提供您的nginx配置?