Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Nginx no se inicia sin registros

Estoy tratando de ejecutar Nginx en la ventana acoplable, pero Nginx sigue fallando.

Archivo de configuración de Nginx:

 worker_processes 1; error_log /var/log/nginx/my_error.log; pid /var/log/nginx/nginx.pid; events { worker_connections 1024; # increase if you have lots of clients accept_mutex off; # set to 'on' if nginx worker_processes > 1 } http { include mime.types; default_type application/octet-stream; sendfile on; upstream app_server { server localhost:5000 fail_timeout=0; } server { client_max_body_size 4G; location @proxy_to_app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; # we don't want nginx trying to do something clever with # redirects, we set the Host: header above already. proxy_redirect off; proxy_pass http://localhost:5000; } listen 443 ssl; ssl_certificate /etc/ssl/certificate.pem; ssl_certificate_key /etc/ssl/key.pem; } }

archivo acoplable:

 RUN apt-get update && apt-get install -y nginx COPY ssl/certificate.pem /etc/ssl/certificate.pem COPY ssl/key.pem /etc/ssl/key.pem COPY nginx_configuration/nginx.conf /etc/nginx/nginx.conf EXPOSE 443 EXPOSE 5000 RUN /etc/init.d/nginx start CMD ["python3", "my_app"]

Pero cuando compruebo el estado de nginx:

 /etc/init.d/nginx status [FAIL] nginx is not running ... failed!

Cuando corro:

 /etc/init.d/nginx start

Todo funciona como se esperaba.

Revisé los archivos de registro, todos están vacíos.

Gracias, Omer

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Esta línea solo se ejecuta durante la creación de la imagen. Entonces, cuando se crea un contenedor "no hace nada"

 RUN /etc/init.d/nginx start

Lo que realmente está ejecutando dentro de su contenedor es este script de python. Creo que no hay ninguna referencia a eso en tu pregunta.

 CMD ["python3", "my_app"]

Puede utilizar el siguiente Dockerfile

 FROM nginx COPY ssl/certificate.pem /etc/ssl/certificate.pem COPY ssl/key.pem /etc/ssl/key.pem COPY nginx_configuration/nginx.conf /etc/nginx/nginx.conf EXPOSE 443 EXPOSE 5000
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!