what does fastcgi_keep_conn do?

nginxuser100 nginx-forum at nginx.us
Fri Mar 20 21:25:48 UTC 2015

Hi, I would like nginx to serve all requests of a given TCP connection to
the same FCGI server. If a new TCP connection is established, then nginx
would select the next UDS FCGI server in round-robin fashion.

Can this be achieved with NGINX, and if yes, how?

I thought turning on fastcgi_keep_conn on would achieve this goal, but it is
not what happened. My obervation was that each FCGI server took turn
receiving a new request even if all the requests are from the same TCP

I had:

upstream backend {
    server unix:/tmp/fastcgi/socket1 ...;
    server unix:/tmp/fastcgi/socket2 ...;
    keepalive 32;

server {
   location <uri> {
        fastcgi_keep_conn on;
        fastcgi_pass  backend;

Thank you.

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

More information about the nginx mailing list