mirror of
https://github.com/linuxserver/docker-swag.git
synced 2026-05-26 20:18:42 +09:00
Backwards compatibility and additional cookie handling tweaks
This commit is contained in:
@@ -12,6 +12,7 @@ location ^~ /authelia {
|
||||
proxy_pass http://$upstream_authelia:9091;
|
||||
|
||||
## Include the Set-Cookie header if present
|
||||
auth_request_set $set_cookie $upstream_http_set_cookie;
|
||||
add_header Set-Cookie $set_cookie;
|
||||
|
||||
proxy_pass_request_body off;
|
||||
@@ -23,16 +24,20 @@ location @authelia_proxy_signin {
|
||||
internal;
|
||||
|
||||
## Include the Set-Cookie header if present
|
||||
auth_request_set $set_cookie $upstream_http_set_cookie;
|
||||
add_header Set-Cookie $set_cookie;
|
||||
|
||||
## Set the $target_url variable based on the original request.
|
||||
## Set the $target_url variable based on the original request
|
||||
set_escape_uri $target_url $scheme://$http_host$request_uri;
|
||||
|
||||
## Set $redirection_url if it is empty
|
||||
if ($redirection_url = false) {
|
||||
set $redirection_url https://$http_host/authelia/?rd=$target_url;
|
||||
## Translate the Location response header from the auth subrequest into a variable
|
||||
auth_request_set $signin_url $upstream_http_location;
|
||||
|
||||
if ($signin_url = '') {
|
||||
## Set the $signin_url variable
|
||||
set $signin_url https://$http_host/authelia/?rd=$target_url;
|
||||
}
|
||||
|
||||
## Redirect to login
|
||||
return 302 $redirection_url;
|
||||
return 302 $signin_url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user