[PATCH v1 1/3] Fix url rewriting from http to https

Claudio Bantaloukas via Sourceware Forge forge-bot+rdfm@forge-stage.sourceware.org
Fri Dec 19 10:13:40 GMT 2025


From: Claudio Bantaloukas <claudio.bantaloukas@arm.com>

---
 .../roles/sourceware_forge_http_frontend/tasks/main.yml     | 2 ++
 .../templates/000-redirect-80.conf.j2                       | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/provisioning/roles/sourceware_forge_http_frontend/tasks/main.yml b/provisioning/roles/sourceware_forge_http_frontend/tasks/main.yml
index 9212379..1d6dc61 100644
--- a/provisioning/roles/sourceware_forge_http_frontend/tasks/main.yml
+++ b/provisioning/roles/sourceware_forge_http_frontend/tasks/main.yml
@@ -32,6 +32,8 @@
       state: present
     - module: ssl
       state: present
+    - module: rewrite
+      state: present
 
 # Debian's certbot package comes with a timer that runs
 # certbot renew twice daily
diff --git a/provisioning/roles/sourceware_forge_http_frontend/templates/000-redirect-80.conf.j2 b/provisioning/roles/sourceware_forge_http_frontend/templates/000-redirect-80.conf.j2
index 912bc50..b99bfeb 100644
--- a/provisioning/roles/sourceware_forge_http_frontend/templates/000-redirect-80.conf.j2
+++ b/provisioning/roles/sourceware_forge_http_frontend/templates/000-redirect-80.conf.j2
@@ -13,7 +13,7 @@
 	CustomLog ${APACHE_LOG_DIR}/access.log combined
 
 	<If "%{REQUEST_URI} !~ m#/\.well-known/acme-challenge/#">
-        Redirect permanent / https://%{HTTP_HOST}/
-    </If>
-
+		RewriteEngine On
+		RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+	</If>
 </VirtualHost>
-- 
2.52.0



More information about the Forge mailing list