Persistent connections timeout (keepalive on upstream)

The short question is how can be set the timeout for an upstream for
persistent connections (using keepalive) - looks like they never
timeout.

Details:

I have a configuration where i need to setup a reverse proxy for SSL
connections, and reuse the backend SSL connections. For doing this i’m
using
the keepalive directive on the upstream, something like this:


upstream backend {
server backend-host.com:443;
keepalive 10;
}

backend-host.com is hosted on Amazon AWS and consists of an Elastic Load
Balancer. This means that from time to time its IP will change (scaling
up
and down)

My issue is that witth the current configuration the persistent
connections
are never refreshed (they don’t have a timeout) and when the IP of the
ELB
changes then the nginx reverse proxy stops working.

Let me know if more info is needed.

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

–On Wednesday, August 26, 2015 3:11 PM -0400 ionut_rusu
[email protected] wrote:

upstream backend {
server backend-host.com:443;
keepalive 10;
}

Have you tried the nginx keepalive module?

https://github.com/nviennot/nginx-tcp-keepalive

–Quanah

Quanah Gibson-Mount
Platform Architect
Zimbra, Inc.

Hi,

You may check dynamic upstream module:

https://github.com/GUI/nginx-upstream-dyanmic-servers

Alternatives:

http://www.senginx.org/en/index.php/Dynamic_DNS_Resolve
http://openresty.org/

Regards,
Biazus

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

Thanks Biazus, i’ll give it a try. Do you know if the keepalive
connections
to the backend have a timeout ? do they recycle ?

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

Hi Quanah,

I think your suggestion is for client -> nginx connections, i need a
setting
for nginx -> backend connections.

Thanks

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

Yes, they do recicle, but it will depends how the keep alive timeout is
configured in the backend.

I believe there is a similar topic here:

http://forum.nginx.org/read.php?2,249924,249953

Regards,
Biazus

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs