Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
Connect Nginx and Django containers [host not found in upstream]

I've created 2 containers for both, Django and Nginx. It's working perfectly on my desktop, but when I pull my images from Docker Hub in an AWS EC2 instence and run, I got this error:

/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/24 15:09:39 [emerg] 1#1: host not found in upstream "my_server:8000" in /etc/nginx/conf.d/default.conf:2
nginx: [emerg] host not found in upstream "my_server:8000" in /etc/nginx/conf.d/default.conf:2

Here is my docker-compose.yml

version: '3.7'

services:
  my_server:
    image: user/image-app
    build:
      context: .
    env_file:
      - ./.env
    ports:
      - "8000:8000"

  nginx:
    build: ./nginx
    image: user/image-nginx
    ports:
      - "80:80"
    depends_on:
      - my_server

volumes:
  static:

My default.conf file

upstream django {
    server my_server:8000;
}

server {
    listen 80;

    location / {
        proxy_pass http://django;
    }
}

Even after I try to add a network and change to "8000:80" the Django ports like this:

version: '3.7'

services:
  scrimmage:
    image: user/image-app
    build:
      context: .
    env_file:
      - ./.env
    ports:
      - "8000:80"
    networks:
      - django_network

  nginx:
    build: ./nginx
    image: user/image-nginx
    container_name: nginx
    ports:
      - "80:80"
    depends_on:
      - scrimmage
    networks:
      - django_network

volumes:
  static:

networks:
  django_network:
    driver: bridge

And change the the default.conf to this:

upstream django {
    server my_server;
}

server {
    listen 80;

    location / {
        proxy_pass http://django;
    }
}

Still not working. Also this changes don't work at my local machine. The first configuration works fine locally, like I said before.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda