我的網站使用IP但不與域一起使用。ip works,domain不,curl -v發現ip但返回空回覆
當我curl -v 'example.com'
(我在的地方例如域)我得到:
* Rebuilt URL to: example.com/
* Trying 123.123.123.123...
* Connected to example.com (123.123.123.123) port 80 (#0)
> GET/HTTP/1.1
> Host: example.com
> User-Agent: curl/7.47.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host example.com left intact
curl: (52) Empty reply from server
然而,當我curl -v '123.123.123.123'
(與我的地方123.123.123.123的IP),一切工作正常,我也得到:
* Rebuilt URL to: 123.123.123.123/
* Trying 123.123.123.123...
* Connected to 123.123.123.123 (123.123.123.123) port 80 (#0)
> GET/HTTP/1.1
> Host: 123.123.123.123
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Sun, 17 Sep 2017 06:45:56 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
<
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World Test Page</title>
</head>
<body>
<h1>Hello World</h1>
<p>Test page.</p>
</body>
</html>
* Connection #0 to host 123.123.123.123 left intact
我在瀏覽器中得到相同的行爲。你好世界頁面顯示與ip但不是與域。
我可能會錯過什麼?
捲曲IP時返回的hello世界內容恰好就是我所期望的index.php
文件的內容。
我在48小時前設置了DNS,所以不應該是問題(並且似乎沒有看到curl在域上查詢時返回正確的IP)。
我曾嘗試在下面的內容中添加一個默認的.htaccess
文件,但這並沒有改變結果。
# basic compression
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js)$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# Protect files and directories
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)? |xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don’t show directory listings
Options -Indexes
# Basic rewrite rules, stop unneeded PERL bot, block subversion directories
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*/)?\.svn/ - [F,L]
ErrorDocument 403 "Access Forbidden"
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* – [F,L]
</IfModule>
我已經爲大量類似的問題提出了stackoverflow,但沒有發現我似乎是完全相同的問題。
任何想法?提前致謝。
(PS:我真的不確定我添加的標籤,因爲我真的不知道問題出在哪裏)。
內部的「 IP主機「和」域主機「可能由該http服務器內的不同虛擬主機處理。我們需要查看主機配置和設置的詳細信息才能提供幫助。 – arkascha
我的/etc/host.conf如下所示: #「訂單」行只用於舊版本的C庫。 訂單主機,綁定 多 –
對不起,但請不要在評論中發佈額外的信息,這是不可能讀取的。您的問題下方有一個「編輯」鏈接。 _使用它_... – arkascha