Hi.
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
https://www.nginx.com/blog/dns-service-discovery-nginx-plus/
My code:
http {
...
resolver 127.0.0.11 valid=5s;
...
server {
set $upstream site;
location /cloudcmd/ {
proxy_pass http://site:8000;
}
location {
proxy_pass http://site;
}
}
Thanks.