docker-swag/root/defaults/nginx/authelia-location.conf.sample

33 lines
1.8 KiB
Plaintext
Raw Normal View History

## Version 2024/03/14 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authelia-location.conf.sample
2020-08-03 11:00:14 -04:00
# Make sure that your authelia container is in the same user defined bridge network and is named authelia
2023-03-28 20:33:53 -04:00
# Rename /config/nginx/proxy-confs/authelia.subdomain.conf.sample to /config/nginx/proxy-confs/authelia.subdomain.conf
# For authelia 4.37 and below, make sure that the authelia configuration.yml has 'path: "authelia"' defined
# For authelia 4.38 and above, make sure that the authelia configuration.yml has 'address: "tcp://:9091/authelia"' defined
2020-08-03 11:00:14 -04:00
## Send a subrequest to Authelia to verify if the user is authenticated and has permission to access the resource
## For authelia 4.37 and below, use the following line
# auth_request /authelia/api/verify;
## For authelia 4.38 and above, use the following line
auth_request /authelia/api/authz/auth-request;
## If the subreqest returns 200 pass to the backend, if the subrequest returns 401 redirect to the portal
2023-02-05 17:45:56 -05:00
error_page 401 = @authelia_proxy_signin;
## Translate the user information response headers from the auth subrequest into variables
auth_request_set $email $upstream_http_remote_email;
2020-08-03 11:00:14 -04:00
auth_request_set $groups $upstream_http_remote_groups;
auth_request_set $name $upstream_http_remote_name;
auth_request_set $user $upstream_http_remote_user;
## Inject the user information into the request made to the actual upstream
proxy_set_header Remote-Email $email;
2020-08-03 11:00:14 -04:00
proxy_set_header Remote-Groups $groups;
proxy_set_header Remote-Name $name;
proxy_set_header Remote-User $user;
## Translate the Set-Cookie response header from the auth subrequest into a variable
2023-02-01 20:35:23 -05:00
auth_request_set $set_cookie $upstream_http_set_cookie;
## Translate the Location response header from the auth subrequest into a variable
auth_request_set $signin_url $upstream_http_location;