Use a named location for authSignURL (#4859)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-24 22:50:25 -03:00 committed by GitHub
parent d83b83bc0d
commit a0523c3c8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 126 additions and 22 deletions

View file

@ -952,6 +952,14 @@ stream {
{{ end }}
{{ if $externalAuth.SigninURL }}
location {{ buildAuthSignURLLocation $location.Path $externalAuth.SigninURL }} {
internal;
return 302 {{ buildAuthSignURL $externalAuth.SigninURL }};
}
{{ end }}
location {{ $path }} {
{{ $ing := (getIngressInformation $location.Ingress $server.Hostname $location.Path) }}
set $namespace {{ $ing.Namespace | quote}};
@ -1071,7 +1079,7 @@ stream {
{{ if $externalAuth.SigninURL }}
set_escape_uri $escaped_request_uri $request_uri;
error_page 401 = {{ buildAuthSignURL $externalAuth.SigninURL }};
error_page 401 = {{ buildAuthSignURLLocation $location.Path $externalAuth.SigninURL }};
{{ end }}
{{ if $location.BasicDigestAuth.Secured }}