D
D
Drummer_hard2014-01-19 01:51:51
Nginx
Drummer_hard, 2014-01-19 01:51:51

Why does Nginx reset the connection immediately after receiving it if I access the site by domain name?

Hi guys. Description:
There is an Ubuntu 12.04 server, Nginx 1.4.4 is installed on it, the last one with a default configuration, by default added only
server_name my-hostname.com;
port 80 to the virtual host. So. if you write the server's IP address in the browser, then everything is in order: the Nginx welcome page is displayed. But if I write my-hostname.com in the browser, the browser displays:
Data not received
The page cannot be loaded - the server is not responding.
I checked the access logs, there is a connection and the log seems to indicate a successful connection:
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" "-"
HTTP code 200, when I go to the IP address, the log is exactly the same.
To check, I did the following in the console on another server
wget my-hostname.com
:
--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 it happens after this command that the server sends index.html with code 200, starts downloading it, then the connection immediately breaks and starts trying again.
First, in the access logs of nginx, there was HTTP code 499, as I found out from Google, it means - 499 Used by Nginx when the client closes the connection before receiving a response. Then something was tricky, the code became 200 (for the life of me I don’t remember what I did) The
DNS server gives the correct IP, there is no doubt about it. Judging by iptraf, the connection goes the same way, but its status is displayed as RESET.
I've been fighting for two days now, I don't know what's wrong. By the way, I installed both Apache and lighttpd, the situation is exactly the same. The server is located in China, inside the "Great Firewall", there may be a problem in it, but I don't understand how. Also, about one time out of fifty, after all, the browser displays the desired page by the domain name.
Please help. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Skazik, 2014-01-19
@Skazik

How does it behave on a port other than 80?

T
tarasui, 2014-02-15
@tarasui

what does it give?
host my-hostname.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question