0

I configured NGINX to redirect all HTTP traffic to HTTPS like this:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name domain.com www.domain.com;
    return 301 https://$host$request_uri;
}

(Not literally domain.com, but my actual domain name)

The redirects are working correctly for domain.com, but when I try accessing www.domain.com, I still get the HTTP version.

Any idea why that could be?

1 Answer 1

0

Nevermind, had the Let's Encrypt certbot adding another listen 80 directive to my HTTPS server block.

Fixed by leting Let's Encrypt manage HTTP -> HTTPS rules (pass "--redirect" to cerbot command).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .