File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -314,13 +314,23 @@ data:
314
314
# List health checks that need to return status 200 here
315
315
map $http_user_agent $hc_ua { default 0; 'GoogleHC/1.0' 1; }
316
316
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
+
317
322
server {
318
323
server_name drupal;
319
324
listen 8080;
320
325
321
326
# Loadbalancer health checks need to be fed with http 200
322
327
if ($hc_ua) { return 200; }
323
328
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
+
324
334
{{- if .Values.nginx.redirects }}
325
335
# Redirects to specified path if map returns anything
326
336
if ($redirect_uri) {
@@ -421,11 +431,6 @@ data:
421
431
422
432
location / {
423
433
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
-
429
434
{{- if .Values.nginx.locationExtraConfig }}
430
435
# Custom configuration gets included here
431
436
{{- tpl .Values.nginx.locationExtraConfig . | nindent 8 }}
You can’t perform that action at this time.
0 commit comments