Config/Annotations: Add relative-redirects. (#12161)

This commit is contained in:
chriss-de 2024-11-13 22:02:48 +01:00 committed by GitHub
parent 0207d1878a
commit 698960e9b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 182 additions and 0 deletions

View file

@ -459,6 +459,10 @@ http {
proxy_intercept_errors on;
{{ end }}
{{ if $cfg.RelativeRedirects }}
absolute_redirect off;
{{ end }}
{{ range $errCode := $cfg.CustomHTTPErrors }}
error_page {{ $errCode }} = @custom_upstream-default-backend_{{ $errCode }};{{ end }}
@ -1343,6 +1347,10 @@ stream {
satisfy {{ $location.Satisfy }};
{{ end }}
{{ if $location.Redirect.Relative }}
absolute_redirect off;
{{ end }}
{{/* if a location-specific error override is set, add the proxy_intercept here */}}
{{ if and $location.CustomHTTPErrors (not $location.DisableProxyInterceptErrors) }}
# Custom error pages per ingress