NGINX persistent connection

rafael.silva nginx-forum at
Thu Apr 15 19:27:06 UTC 2021


Is it possible for me to persist a connection?

Reason... I use NGINX with Swarm, proxy_pass with resolved.
When I have a service with multiple containers, the service cloudcmd does
not work because it does not accept replication, because swith each request,
Swarm delivers a different IP.

Is it possible to do an upstream that takes an IP and fixes it until it is
down? I tried to use keepalived but it didn't work well.

I tried to do this configuration, but kept picking up multiples IP

My code:
http {
  resolver valid=5s;
  server {
    set $upstream site;
    location /cloudcmd/ {
      proxy_pass http://site:8000;
    location {
      proxy_pass http://site;


Posted at Nginx Forum:,291271,291271#msg-291271

More information about the nginx mailing list