Disabling keepalive

Maxim Dounin mdounin at mdounin.ru
Fri Oct 21 15:16:11 UTC 2022


Hello!

On Fri, Oct 21, 2022 at 11:02:20AM -0400, libresco_27 wrote:

> Is there a way to totally disable keepalive form upstream? Right now, I have
> the following configuration in upstream to keep the figures to a minimum-
> 
> keepalive: 1;
> keepalive_requests: 1;
> keepalive_timeout: 1s;
> keepalive_time: 1s
> 
> Since, I can't change the keepalive directive's value to 0, is there a way I
> can remove this setting totally?

Keepalive connections with upstream servers are disabled by 
default.  That is, it is enough to remove the "keepalive" 
directive from the upstream block to disable connection cache 
completely.

Note that you may also want to adjust proxying configuration to 
ensure connections are closed by the upstream server when 
possible.  In particular, make sure you are not using 
"proxy_set_header Connection "";" with HTTP proxying and/or 
"fastcgi_keep_conn on;" with FastCGI.

See http://nginx.org/r/keepalive for details.

-- 
Maxim Dounin
http://mdounin.ru/



More information about the nginx mailing list