Skip to content

Commit 5924bad

Browse files
authored
Merge branch 'master' into feature/SLT-901-cronjob-defaults
2 parents 9c2739d + 5cbc04d commit 5924bad

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: charts/drupal/templates/drupal-configmap.yaml

+10-5
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,23 @@ data:
314314
# List health checks that need to return status 200 here
315315
map $http_user_agent $hc_ua { default 0; 'GoogleHC/1.0' 1; }
316316
317+
{{- if ne .Values.nginx.x_proxy_auth "" }}
318+
# Verify if x_proxy_auth value is correct
319+
map $http_x_proxy_auth $proxy_auth { default 0; '{{ .Values.nginx.x_proxy_auth }}' 1; }
320+
{{- end}}
321+
317322
server {
318323
server_name drupal;
319324
listen 8080;
320325
321326
# Loadbalancer health checks need to be fed with http 200
322327
if ($hc_ua) { return 200; }
323328
329+
{{- if ne .Values.nginx.x_proxy_auth "" }}
330+
# Block request if proxy header is set but does not match required value
331+
if ($proxy_auth = 0) { return 403; }
332+
{{- end}}
333+
324334
{{- if .Values.nginx.redirects }}
325335
# Redirects to specified path if map returns anything
326336
if ($redirect_uri) {
@@ -421,11 +431,6 @@ data:
421431
422432
location / {
423433
424-
{{- if ne .Values.nginx.x_proxy_auth "" }}
425-
# Verify if x_proxy_auth value is correct
426-
if ( $http_x_proxy_auth != '{{ .Values.nginx.x_proxy_auth }}') { return 403; }
427-
{{- end}}
428-
429434
{{- if .Values.nginx.locationExtraConfig }}
430435
# Custom configuration gets included here
431436
{{- tpl .Values.nginx.locationExtraConfig . | nindent 8 }}

0 commit comments

Comments
 (0)