简体   繁体   中英

nginx reset incoming connections by domain name

I have Ubuntu server 12.04, installed Nginx 1.4.4 with default configuration. In nginx default virtual host added: server_name my-hostname.com; 80 port is opened. So, if I enter in browser IP address of my server thats all ok: I see nginx default page. But when I enter my-hostname.com then browser displayed:

The Web page is not available.
Connection to my-hostname.com interrupted.

I checked in access logs -my connect there is, and connect is successful:

85.115.224.193 - - [19/Jan/2014:06:29:14 +0800] "GET / HTTP/1.1" 200 0 "-" "Mozilla/5.0      (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95   YaBrowser/13.10.1500.9323 Safari/537.36" "-"

HPPT code is 200. When I enter to website by IP address that log the same. From another server did follow:

wget my-hostname.com

And result is:

--2014-01-18 22:37:23-- my-hostname.com
Resolving my-hostname.com (my-hostname.com)... 42.96.*.*
Connecting to my-hostname.com (my-hostname.com)|42.96.*.*|:80... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.

Sometimes there is after run this command the server gives index.html with a code 200, starts it downloading then connection breaks and starts trying anew.

In first in access logs was the HTTP code 499, fhow google I learned this code is mean:

499 Client Closed Request (Nginx)
Used in Nginx logs to indicate when the connection has been closed by client while the     server is still processing its request, making server unable to send a status code back.

DNS server return true IP address. According to iptraf connect there is but status RESET.

I have installed apache and lighttpd, the situation absolutely same. The server is in China, inside "The Great Firewall", it could be the problem. Approximately one out of fifty, the browser displays the needed page by the domain name. Ask for help. Thank you.

Well I have exactly the same problem.

From a foreign (as to China) IP, it is likely to get a connection reset when connecting to a server/IP in China; but if you try to access the server/IP from an IP in China, mostly it works.

It is GFW 's fault, you can try to change the server's domain (and IP) in China, and see if it works.

Or you can try to move the server out of China and that should fix all the issues :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM