keepalive and 5xx
gfrankliu at gmail.com
Tue Jul 10 23:59:43 UTC 2018
When you say "Keepalive is automatically switched off...", do you mean
nginx will send "Connection: close" as part of the response? What happens
if client doesn't honor that, and keeps sending another request to the
You also mentioned "error codes is generated by nginx itself", so what
happens if nginx is used as reverse proxy, and the error code is coming
from upstream? Will nginx switch off keepalive with client too?
On Tue, Jul 10, 2018 at 10:04 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Mon, Jul 09, 2018 at 05:16:36PM -0700, Frank Liu wrote:
> > Does nginx automatically disconnect keepalive connection if 5xx response
> > code is generated?
> Not really. Keepalive is automatically switched off when a
> response with one of the following error codes is generated by
> nginx itself:
> - 400 Bad Request
> - 413 Request Entity Too Large
> - 414 Request URI Too Large
> - 500 Internal Server Error
> - 501 Not Implemented
> This is because such errors indicate that we might not be able
> to maintain protocol state properly, and hence we need to close
> the connection.
> Details can be found in the ngx_http_special_response_handler()
> function, see here:
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx