changeset 474:28d327443c45

Keep host on redir to HTTPS to fix HSTS Apparently it doesn't apply if you redirect from http with no-www to https with www (or vice versa)
author IBBoard <dev@ibboard.co.uk>
date Sun, 11 Aug 2024 11:16:05 +0100
parents 9437c6ffa07c
children 1d39bde7f909
files modules/website/manifests/https.pp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/website/manifests/https.pp	Sat May 25 18:31:52 2024 +0100
+++ b/modules/website/manifests/https.pp	Sun Aug 11 11:16:05 2024 +0100
@@ -143,7 +143,9 @@
   $redir_fragment = "
 	# Filter before we redirect to HTTPS
 	Include conf.custom/filter-core.conf
-	Redirect permanent / https://$name/"
+	<Location />
+		Redirect permanent https://%{HTTP_HOST}%{REQUEST_URI}
+	</Location>"
 
 
   apache::vhost { $name: