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

226
Vistas
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 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