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

225
Visualizações
My http://www.example.com redirects to https, but my http://example.com doesn`t. Why

I'm trying to make my website be accessible throught these 4 options (2 throught HTTPS, and 2 throught HTTP to be redirected to HTTPS): https://www.example.com, https://example.com, http://www.example.com and http://example.com, but the last one is the only one which doesn't work, for some reason, instead of redirecting from http://example.com to https://example.com, it goes to the VPS server IP with the port at the end, example http://123.456.0.789:3000 and it returns a timeout error.

My domain isn't in the same place as the VPS server, so I changed the domain records type to match the VPS IP. A (@) -> VPS IP / A (www) -> VPS IP / AAAA (@) -> VPS IPV6

Here is my Nginx config:

server {
        server_name www.example.com example.com;
        location /socket.io/ {
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_pass http://localhost:3000;
        }
        location / {
                proxy_pass http://localhost:3000;
        }
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem; # manage>
        ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem; # mana>
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server {
        if ($host = example.com) {
                return 301 https://$host$request_uri;
        } # managed by Certbot
        if ($host = www.example.com) {
                return 301 https://$host$request_uri;
        } # managed by Certbot
        listen 80;
        server_name www.example.com example.com;
        return 404; # managed by Certbot
}
over 4 years ago · Santiago Trujillo
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