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:
http://forum.nginx.org/read.php?2,254535,254535#msg-254535

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:
http://forum.nginx.org/read.php?2,254535,254536#msg-254536

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:
http://forum.nginx.org/read.php?2,254535,254546#msg-254546

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
http://nginx.org/r/keepalive_timeout.


Maxim D.
http://nginx.org/

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

GREATLY APPRECIATED.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,254535,254548#msg-254548

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


Igal Sapir
Railo Core Developer
http://getRailo.org/

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:
http://forum.nginx.org/read.php?2,254535,254577#msg-254577

ping ?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,254535,254639#msg-254639