Merge pull request #1164 from aledbf/oauth2-auth
Use variable request_uri as redirect after auth
This commit is contained in:
commit
fe33cd3e46
1 changed files with 3 additions and 2 deletions
|
@ -350,7 +350,6 @@ http {
|
||||||
|
|
||||||
client_max_body_size "{{ $location.Proxy.BodySize }}";
|
client_max_body_size "{{ $location.Proxy.BodySize }}";
|
||||||
|
|
||||||
|
|
||||||
set $target {{ $location.ExternalAuth.URL }};
|
set $target {{ $location.ExternalAuth.URL }};
|
||||||
proxy_pass $target;
|
proxy_pass $target;
|
||||||
}
|
}
|
||||||
|
@ -378,13 +377,15 @@ http {
|
||||||
{{ if not (empty $authPath) }}
|
{{ if not (empty $authPath) }}
|
||||||
# this location requires authentication
|
# this location requires authentication
|
||||||
auth_request {{ $authPath }};
|
auth_request {{ $authPath }};
|
||||||
|
auth_request_set $auth_cookie $upstream_http_set_cookie;
|
||||||
|
add_header Set-Cookie $auth_cookie;
|
||||||
{{- range $idx, $line := buildAuthResponseHeaders $location }}
|
{{- range $idx, $line := buildAuthResponseHeaders $location }}
|
||||||
{{ $line }}
|
{{ $line }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if not (empty $location.ExternalAuth.SigninURL) }}
|
{{ if not (empty $location.ExternalAuth.SigninURL) }}
|
||||||
error_page 401 = {{ $location.ExternalAuth.SigninURL }};
|
error_page 401 = {{ $location.ExternalAuth.SigninURL }}?rd=$request_uri;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue