Connection close on 500, 503, 502

Hi There,

I want to send a connection_close to the client whenever the HTTP status
is
any of the 50X codes. How could i accomplish this?

Thanks for your response.

Posted at Nginx Forum:

Can i do something like: (i don’t really need a page necessarily - i am
purely interested in changing the connection from keep-aline to
connection-close)

error_page 500 502 503 504 /ServiceUnavailableError.xml;

     location = /ServiceUnavailableError.xml {
          root /error_pages/;
          internal;
          default_type text/xml;

          keepalive_requests 0;
      }

Posted at Nginx Forum:

Can i just do this:

error_page 404 =400;
error_page 502 =500 @close_conns;
    location @close_conns {
        internal;
        keepalive_requests 0;
    }

Posted at Nginx Forum:

Hello!

On Mon, Nov 03, 2014 at 04:14:13PM -0500, newnovice wrote:

Can i just do this:

error_page 404 =400;
error_page 502 =500 @close_conns;
    location @close_conns {
        internal;
        keepalive_requests 0;
    }

Something like “keepalive_timeout 0;” should be a better choice,
as it is documented to disable keepalive connections, see
Module ngx_http_core_module.


Maxim D.
http://nginx.org/

Thank you MAXIM - you have been the most responsive & helpful on these
forums.

GREATLY APPRECIATED.

Posted at Nginx Forum:

Thank you MAXIM - you have been the most responsive & helpful on these
forums.
+1


Igal Sapir
Railo Core Developer

I have this in config:

error_page 404 =400;
error_page 500 502 503 504 =500 @close_conns;

    location @close_conns {
        internal;
        keepalive_timeout 0;
    }

I still see 502’s behind returned in ‘$status’ - Why would this happen?
I
was expecting to see a 500, based on my config.
I also see 404’s - which should have been transformed to 400.

Posted at Nginx Forum:

ping ?

Posted at Nginx Forum: