title: Docker compose error: nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:21
body: <p>Trying to run nginx and web application via docker compose</p>
  <p>dockerfile</p>
  <pre><code>FROM node:12.16.2 as build
  
  RUN mkdir /app
  
  COPY package*.json ./
  RUN npm install
  
  COPY . /app
  RUN npm run-script build
  
  COPY --from=build /app/build /var/www/roundmap.app
  
  EXPOSE 3000
  </code></pre>
  <p>nginx config defauls.conf</p>
  <pre><code>server {
    listen 80;
    listen 443 ssl;
    listen 3000;
    server_name *.roundmap.app 185.146.157.206;
  
    root /var/www/roundmap.app;
    index index.html;
  
    ssl_certificate /etc/ssl/roundmap/roundmap.crt;
    ssl_certificate_key /etc/ssl/roundmap/roundmap.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!MD5;
  
    if ($scheme = http) {
      return 301 https://$server_name$request_uri;
    }
  
    location / {
      proxy_pass https://app:3000;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
    }
  }
  </code></pre>
  <p>docker-compose.yml</p>
  <pre><code>version: &quot;4&quot;
  services:
      app:
          build: roundmap/
          container_name: app
          ports:
              - 3000:3000
      nginx:
          image: nginx:1.17.2-alpine
          container_name: nginx
          ports:
              - 80:80
              - 443:443
          links:
              - app
          volumes:
              - ./default.conf:/etc/nginx/conf.d/default.conf
              - /etc/ssl/roundmap/roundmap.crt:/etc/ssl/roundmap/roundmap.crt
              - /etc/ssl/roundmap/roundmap.key:/etc/ssl/roundmap/roundmap.key
  </code></pre>
  <p>running via docker-compose up
  and getting error</p>
  <p>nginx    | 2020/07/20 16:39:19 [emerg] 1#1: host not found in upstream &quot;app&quot; in /etc/nginx/conf.d/default.conf:22
  nginx    | nginx: [emerg] host not found in upstream &quot;app&quot; in /etc/nginx/conf.d/default.conf:22
  nginx exited with code 1</p>
  <p>Сan you please help where am I mistaken?</p>