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

468
Vistas
Using SSL with nginx and Ubuntu on AWS EC2 is not working

I'm struggling with setting up a SSL for my EC2 instance on Ubuntu, I did it without any problems on Amazon AMI, but I have some problems with Ubuntu:

  1. ✅ Added 443 port for SSL in Security groups
  2. ✅ Generated letsencrypt key via certbot
  3. ✅ Redirected http request to the https in nginx.conf
  4. ✅ Restarted nginx

And I have timeout when I'm accessing my site via https, could help me with debugging this issue?

Here is my nginx.conf:

server {
  listen 80;
  listen [::]:80;
  server_name mydomain.com;
  return 301 https://$server_name$request_uri;
}

server {
  listen 443 ssl;
  listen [::]:443 ssl;
  server_name mydomain.com;
  root /home/ubuntu/myproject;

  add_header Strict-Transport-Security "max-age=15768000";
  ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;

  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

  location / {
    proxy_pass http://127.0.0.1:8000;
    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_redirect off;
  }
}

Note: Everything is working via HTTP when I'm disabling redirect in nginx.

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

0

As you said this configuration was ok, I've terminated an instance and reinstall nginx and works properly right now.

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