Add override for proxy_intercept_errors when using Custom HTTP Errors (#9497)

* added proxy-intercept-errors config option

* fixed error when comparing locations

* fixed missing location config from annotation
added e2e test

* reversed logic for proxy-intercept-errors to disable-proxy-intercept-errors

* reversed logic to disable-proxy-intercept-errors

* reversed logic

* default has to be false

* put comment in same line as return

* run gofmt

* fixing wrong Boilerplate header

* updated code to new IngressAnnotation interface

* fixes to satisfy PR comments

* synced with upstream; fixed typo

* gofumpt disableproxyintercepterrors.go

* gofumpt
This commit is contained in:
chriss-de 2023-11-17 05:43:54 +01:00 committed by GitHub
parent e0446d7554
commit ad406b64d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 395 additions and 108 deletions

View file

@ -487,7 +487,7 @@ http {
ssl_certificate {{ $cfg.DefaultSSLCertificate.PemFileName }};
ssl_certificate_key {{ $cfg.DefaultSSLCertificate.PemFileName }};
{{ if gt (len $cfg.CustomHTTPErrors) 0 }}
{{ if and $cfg.CustomHTTPErrors (not $cfg.DisableProxyInterceptErrors) }}
proxy_intercept_errors on;
{{ end }}
@ -1473,7 +1473,7 @@ stream {
{{ end }}
{{/* if a location-specific error override is set, add the proxy_intercept here */}}
{{ if $location.CustomHTTPErrors }}
{{ if and $location.CustomHTTPErrors (not $location.DisableProxyInterceptErrors) }}
# Custom error pages per ingress
proxy_intercept_errors on;
{{ end }}