From 4b9ceede3ae329e55a699d5c4c4b012a8267b64f Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Wed, 18 Dec 2024 14:31:04 +0100 Subject: [PATCH] Set X-Forwarded-Proto only if empty As done for neutron-operator [1], adding a conditional to set the header only if it is empty. This is required in case we deploy with tls.podlevel=false and tls.ingress=true. [1] openstack-k8s-operators/neutron-operator#453 Signed-off-by: Francesco Pantano --- templates/swiftproxy/config/httpd.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/swiftproxy/config/httpd.conf b/templates/swiftproxy/config/httpd.conf index 6ec35e11..aca5a46c 100644 --- a/templates/swiftproxy/config/httpd.conf +++ b/templates/swiftproxy/config/httpd.conf @@ -34,7 +34,11 @@ CustomLog /dev/stdout proxy env=forwarded ## Request header rules ## as per http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader - RequestHeader set X-Forwarded-Proto "https" +{{- if $vhost.TLS }} + RequestHeader setIfEmpty X-Forwarded-Proto "https" +{{- else }} + RequestHeader setIfEmpty X-Forwarded-Proto "http" +{{- end }} LimitRequestBody 5368709122 LimitRequestFields 200