Dynamic upstream configuration

krukow nginx-forum at nginx.us
Mon May 13 13:06:44 UTC 2013

mamoos1 Wrote:
> I know that I can configure keep-alive with upstream - but that
> requires me to know upfront which servers will be used (which I don't,
> since I dynamically fetch content according to headers).
> Is there a way to configure that the proxy will keep-alive connections
> with backend servers dynamically, or for some time?

I'm facing a similar issue right now where I need to enable 
persistent/keepalive connections to a dynamic set of upstreams. This is 
not running SSL, but for various reasons upstream servers are slow at 
establishing connections and persistent connections are a real 
performance boost. 

We dynamically find the upstream using  lua scripting. What I'd like
is to dynamically define an upstream including keepalive (ideally in lua).

Has anyone found a way to achieve this, or is it simple not possible at 
the moment?

- Karl

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

More information about the nginx mailing list