ngnix is not closing the socket after the connection finishes. I've googled and can't come up with anything to will tell nginx to close this connection, other than what I have below: keepalive_timeout 0.

In both the request and response headers, I can see Connection: close, but the socket still sits around in the TIME_WAIT state for about a minute.

tcp 0 0 TIME_WAIT -

Here are the headers:

Request Headers: Connection: close Content-Type: application/x-www-form-urlencoded

Response headers: HTTP/1.1 200 OK Server: nginx/0.7.67 Date: Thu, 21 Apr 2011 15:34:31 GMT Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked Connection: close

Part of my nginx config:

nginx config file: { ... keepalive_timeout 0; client_max_body_size 1M; fastcgi_read_timeout 60; fastcgi_send_timeout 60;

location ~ \.php$ {
    fastcgi_pass   unix:/tmp/php-fastcgi.sock;
    fastcgi_index  index.php;
    fastcgi_intercept_errors on; # to support 404s for PHP files not found
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
    fastcgi_param SERVER_NAME $host;



Waiting in TIME_WAIT state for few minutes is by design, please check following links for full description:

http://developerweb.net/viewtopic.php?id=2941 http://www.ssfnet.org/Exchange/tcp/tcpTutorialNotes.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.