How do I set Keep Alive

CJ Ess zxcvbn4038 at
Wed Mar 9 13:48:48 UTC 2016

If your backend is sensitive to keepalive traffic (mine are), then my
advice is to enable keepalives as far into your stack as you can.

i.e. I have nginx fronting haproxy and varnish, I enable keepalives to both
haproxy and varnish add have them add a "connection: close" header to their
backend requests. That keeps the backends happy but still lets the
frontends take advantage of connection reuse.

On Wed, Mar 9, 2016 at 2:15 AM, RemcoJanssen <nginx-forum at>

> Hello, I am new to nginx and Speedgrade suggest I enable keepalive to
> enhance performance of my website(s).
> I've read*1 that enabling this is also a risk. What is the best practise?
> *1
> Posted at Nginx Forum:
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list