Fix dynamic configuration when custom errors are enabled (#2212)
This commit is contained in:
parent
de30e53d62
commit
6b7491f432
2 changed files with 3 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
@ -591,6 +591,7 @@ stream {
|
||||||
|
|
||||||
{{/* definition of templates to avoid repetitions */}}
|
{{/* definition of templates to avoid repetitions */}}
|
||||||
{{ define "CUSTOM_ERRORS" }}
|
{{ define "CUSTOM_ERRORS" }}
|
||||||
|
{{ $dynamicConfig := .DynamicConfigurationEnabled}}
|
||||||
{{ $proxySetHeaders := .ProxySetHeaders }}
|
{{ $proxySetHeaders := .ProxySetHeaders }}
|
||||||
{{ range $errCode := .Cfg.CustomHTTPErrors }}
|
{{ range $errCode := .Cfg.CustomHTTPErrors }}
|
||||||
location @custom_{{ $errCode }} {
|
location @custom_{{ $errCode }} {
|
||||||
|
@ -607,7 +608,7 @@ stream {
|
||||||
|
|
||||||
rewrite (.*) / break;
|
rewrite (.*) / break;
|
||||||
|
|
||||||
{{ if .DynamicConfigurationEnabled }}
|
{{ if $dynamicConfig }}
|
||||||
proxy_pass http://upstream_balancer;
|
proxy_pass http://upstream_balancer;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
proxy_pass http://upstream-default-backend;
|
proxy_pass http://upstream-default-backend;
|
||||||
|
|
Loading…
Reference in a new issue