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?