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

223
Views
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
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!