Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

472
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda