title: Load balancer/reverse proxy: "upstream server temporarily disabled while connecting to upstream" in docker-swarm?
body: <p>I am running 1 manager and 2 workers nodes in docker-swarm.</p>
  
  <p>The worker nodes are running 3 stacks with php/nginx website, so that's site1, site2, site3 that load "This is site*/(worker1 or worker2)" in the browser.
  That works fine when I put a reverse proxy on one of the nodes.</p>
  
  <p>But I want to put a single load balancer/reverse proxy on the manager node, I also disabled the other 2 stacks so in this example only "site1" stack is on both worker nodes. Their Ip's are "10.0.14.16" and "10.0.14.17".</p>
  
  <p>This is the LB/RP nignx configuration file.</p>
  
  <pre><code>   upstream site1_nginx  {
       server 10.0.14.16;
       server 10.0.14.17;
     }
     server {
         listen 80;
         server_name site1.local;
  
         location / {
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_pass http://site1_nginx;
  
         }
     }
  </code></pre>
  
  <p>and this is the docker compose file of the nignx:</p>
  
  <pre><code>version: '3'
  
  services:
    nginx:
        image: nginx:latest
        deploy:
          placement:
            constraints:
              - node.role==manager
          mode: global
        ports:
            - "80:80"
        volumes:
            - "./conf.d/:/etc/nginx/conf.d"
  
        networks:
            - reprox
  networks:
    reprox:
      external: true
  </code></pre>
  
  <p>But I get this error when I create the service:</p>
  
  <pre><code>loadbalancer_nginx.0.ua0z0l8gm18e@ubuntu-vm1    | 2019/10/11 14:36:00 [error] 6#6: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 10.255.0.2, server: site1.local, request: "GET / HTTP/1.1", upstream: "http://10.0.14.17:80/", host: "site1.local"
  loadbalancer_nginx.0.ua0z0l8gm18e@ubuntu-vm1    | 2019/10/11 14:36:00 [warn] 6#6: *12 upstream server temporarily disabled while connecting to upstream, client: 10.255.0.2, server: site1.local, request: "GET / HTTP/1.1", upstream: "http://10.0.14.17:80/", host: "site1.local"
  loadbalancer_nginx.0.ua0z0l8gm18e@ubuntu-vm1    | 2019/10/11 14:36:00 [error] 6#6: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 10.255.0.2, server: site1.local, request: "GET / HTTP/1.1", upstream: "http://10.0.14.16:80/", host: "site1.local"
  loadbalancer_nginx.0.ua0z0l8gm18e@ubuntu-vm1    | 2019/10/11 14:36:00 [warn] 6#6: *12 upstream server temporarily disabled while connecting to upstream, client: 10.255.0.2, server: site1.local, request: "GET / HTTP/1.1", upstream: "http://10.0.14.16:80/", host: "site1.local"
  loadbalancer_nginx.0.ua0z0l8gm18e@ubuntu-vm1    | 2019/10/11 14:36:01 [error] 6#6: *12 no live upstreams while connecting to upstream, client: 10.255.0.2, server: site1.local, request: "GET / HTTP/1.1", upstream: "http://site1_nginx/", host: "site1.local"
  </code></pre>
  
  <p>Also if you need, the site1 nginx site configuration:</p>
  
  <pre><code>server {
      listen 80 default_server;
      listen [::]:80 default_server;
  
      index index.php index.html;
      server_name site1.local;
      resolver 127.0.0.11;
  
      error_log  /var/log/nginx/error.log;
      access_log /var/log/nginx/access.log;
      root /code;
  
      location / {
          try_files $uri $uri/ =404;
      }
  
      location ~ \.php$ {
          set $upstream php:9000;        
          try_files $uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass $upstream;
          fastcgi_index index.php;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param PATH_INFO $fastcgi_path_info;
      }
  }
  </code></pre>
  
  <p>docker networks are fine, I do have an overlay network and network between php and nignx.</p>