FastCGI KeepAlive

Maxim Dounin mdounin at
Wed Jun 21 16:55:11 UTC 2017


On Wed, Jun 21, 2017 at 12:09:17PM -0400, Olaf van der Spek wrote:

> What does it take to enable KeepAlive for FastCGI upstream servers?
> I've set upstream { keepalive 99; } and location { fastcgi_keep_conn on; ]
> but nginx is still closing the connection after each request.

With FastCGI, keepalive directive in the upstream{} 
block and fastcgi_keep_conn in the location with fastcgi_pass 
should be enough.  Detailed example can be found in the documentation,

If it doesn't work for you, consider providing more details on 
your configuration and what you observe.

Maxim Dounin

More information about the nginx mailing list