From 841fcb6be3dc8c8db1e13d227f792b0e474ef20a Mon Sep 17 00:00:00 2001 From: Adam French Date: Fri, 21 Nov 2025 12:39:36 +0000 Subject: [PATCH] redirect to www. https --- nginx/nginx.conf.template | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index 4551c40..43fe37f 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -20,15 +20,21 @@ http { # Redirect everything else to HTTPS location / { - return 301 https://$host$request_uri; + return 301 https://www.$DOMAIN$request_uri; } } + server { + listen 443 ssl; + server_name $DOMAIN; + + return 301 https://www.$DOMAIN$request_uri; + } server { listen 443 ssl; http2 on; - server_name $DOMAIN www.$DOMAIN; + server_name www.$DOMAIN; root /etc/nginx/html; index index.html;