Add CustomHTTPErrors directive (#11699)
* Add CustomHTTPErrors directive * Fix: Add missing '=' in error_page directive
This commit is contained in:
parent
abb87ca750
commit
1ef5295ffe
2 changed files with 6 additions and 0 deletions
|
@ -284,6 +284,11 @@ func (c *Template) buildHTTP() {
|
|||
httpBlock = append(httpBlock, buildMapDirective("$http_referer", "$block_ref", refDirectives))
|
||||
}
|
||||
|
||||
for _, v := range cfg.CustomHTTPErrors {
|
||||
httpBlock = append(httpBlock, buildDirective("error_page", v, "=",
|
||||
fmt.Sprintf("@custom_upstream-default-backend_%d", v)))
|
||||
}
|
||||
|
||||
c.config.Parsed = append(c.config.Parsed, &ngx_crossplane.Directive{
|
||||
Directive: "http",
|
||||
Block: httpBlock,
|
||||
|
|
|
@ -407,6 +407,7 @@ http {
|
|||
default "$";
|
||||
}
|
||||
|
||||
# MIGRATED
|
||||
{{ range $errCode := $cfg.CustomHTTPErrors }}
|
||||
error_page {{ $errCode }} = @custom_upstream-default-backend_{{ $errCode }};{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue