proxy_set_header Connection "";

Robert Paprocki rpaprocki at
Fri Sep 30 16:27:30 UTC 2016

On Fri, Sep 30, 2016 at 9:24 AM, Grant <emailgrant at> wrote:

> > By default the Connection header is passed to the origin. If a client
> sends
> > a request with Connection: close, Nginx would send this to the upstream,
> > effectively disabling keepalive. By clearing this header, Nginx will not
> > send it on to the upstream source, leaving it to send its own Connection
> > header as appropriate.
> That makes perfect sense.  Is there a way to test if keepalive is
> active between nginx and the upstream server?
> - Grant

A few quick thoughts come to mind:

- tcpdump traffic between nginx and upstream (this seems like the best way
to verify given that keepalive behavior directly affects tcp traffic, so
you want to examine this directly)
- examine nginx debug logs to show what headers are being passed to /
received from upstream (requires your nginx to be built with --with-debug)
- query kernel for status of tcp connections while simulating traffic
between nginx and upstream (eg netstat, ss, etc)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list