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

495
Vistas
Nginx up like orphan containers and not working (521 error)

I am using a container Nginx with docker-compose, but It have a bad configuration. When I link the domain to 8000 port I have a 521 error.

enter image description here

It is my Dockerfile:

 FROM nginx
 COPY nginx.conf /etc/nginx/nginx.conf

I used nginx-alpine, but it not working without alpine python, and I had to change it because Pandas not working with alpine.

So, my nginx.conf is:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
 worker_connections  1024;  ## Default: 1024, increase if you have lots of clients
}

http {
 include       /etc/nginx/mime.types;
 # fallback in case we can't determine a type
 default_type  application/octet-stream;

 log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
 '$status $body_bytes_sent "$http_referer" '
 '"$http_user_agent" "$http_x_forwarded_for"';

 access_log  /var/log/nginx/access.log  main;

 sendfile        on;
 #tcp_nopush     on;

 keepalive_timeout  65;

 upstream app {
    server django:5000;
 }

server {
# use 'listen 80 deferred;' for Linux
# use 'listen 80 accept_filter=httpready;' for FreeBSD
listen 5000;
charset utf-8;

# Handle noisy favicon.ico messages in nginx
 location = /favicon.ico {
    return 204;
    access_log     off;
    log_not_found  off;
}

 location / {
    # checks for static file, if not found proxy to app
    try_files $uri @proxy_to_app;
}

# django app
 location @proxy_to_app {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forward-Proto http;
    proxy_set_header X-Nginx-Proxy true;
    proxy_temp_file_write_size 64k;
    proxy_connect_timeout 10080s;
    proxy_send_timeout 10080;
    proxy_read_timeout 10080;
    proxy_buffer_size 64k;
    proxy_buffers 16 32k;
    proxy_busy_buffers_size 64k;
    proxy_redirect off;
    proxy_request_buffering off;
    proxy_buffering off;
    proxy_pass http://app;
}
}
}

When I build and up my application, not show any error, and I tip "docker-compose ps" it appear, like the photo, but in some time it disappear, and if I try to do some action with some container, it response:

WARNING: Found orphan containers (core_nginx_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

I tried to make a .env with COMPOSE_PROJECT_NAME=CORE but not working anyway.

It is my production.yml:

nginx:
  build: ./compose/production/nginx
  image: core_production_nginx
  ports:
  - 80:80
  depends_on:
  - django

I tried to add 80:5000 but it response me a error.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

When your container disappeared that means that it down. You can see all containers, upped and down, with command docker ps -a. You will find your disappeared container here

When you use command docker ps you never see any errors. This command show you only working containers. If you want to see errors inside the container, you should use command docker logs <container name>. And when your container disappeared that means that it down. You can see all containers, upped and down, with command docker ps -a. You will find your disappeared container here. You should use docker logs and you will see why this container down.

over 4 years ago · Santiago Trujillo Denunciar
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