From d20ca7ab42c157bca5551420d98b106306baa564 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Wed, 18 Dec 2024 14:15:25 +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] https://github.com/openstack-k8s-operators/neutron-operator/pull/453 Signed-off-by: Francesco Pantano --- templates/common/config/10-glance-httpd.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/common/config/10-glance-httpd.conf b/templates/common/config/10-glance-httpd.conf index e36f4e9b..21f4ad12 100644 --- a/templates/common/config/10-glance-httpd.conf +++ b/templates/common/config/10-glance-httpd.conf @@ -11,7 +11,11 @@ ## 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 }} TimeOut {{ $vhost.TimeOut }}