Skip to content

Commit

Permalink
[httpd] Set X-Forwarded-Proto only if empty
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fmount committed Dec 18, 2024
1 parent b58a81d commit 7954f9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/swiftproxy/config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7954f9f

Please sign in to comment.