title: Docker nginx cannot connect to Docker uwsgi
body: <p>I have a uwsgi (python flask app) running in a Docker exposed port 8080.</p>
  <p>I have an nginx running in another Docker ports 80 and 443.</p>
  <p>Here is a snippet from my config</p>
  <pre><code>upstream backend {
      server my-uwsgi:8080;
  }
  
  server {
      server_name api.my.app my.app;
  
      listen 80;
      listen [::]:80;
  
      return 301 https://$host$request_uri;
  }
  
  server {
      server_name api.my.app my.app;
  
  ...
  
      location = /demo1/byAddress
      {
          include uwsgi_params;
          uwsgi_param X-Real-IP  $remote_addr;
          uwsgi_param X-Forwarded-For $remote_addr;
          uwsgi_param Host $host;
          uwsgi_pass backend;
      }
  </code></pre>
  <p>This does stand up, but is non functional.</p>
  <p>In the nginx docker I can do <code>telnet my-uwsgi:8080</code> so I know it can connect to the uwsgi Docker.</p>
  <p>But in /var/log/nginx/error.log This is the first entry:</p>
  <pre><code>2022/01/10 00:04:49 [emerg] 9#9: host not found in upstream &quot;my-uwsgi:8080&quot; in `/etc/nginx/conf.d/my.conf:10`
  </code></pre>
  <p>I cannot figure out a combination that works, what is the magic that I am missing here?</p>
  <p>Thanx</p>