From 777fa62481f04c4d9fc9868d7e4b8839d6473509 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 1 Feb 2023 19:35:23 -0600 Subject: [PATCH] Add new headers --- .../defaults/nginx/authelia-location.conf.sample | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/root/defaults/nginx/authelia-location.conf.sample b/root/defaults/nginx/authelia-location.conf.sample index 5331a9c..566d1b2 100644 --- a/root/defaults/nginx/authelia-location.conf.sample +++ b/root/defaults/nginx/authelia-location.conf.sample @@ -8,18 +8,30 @@ auth_request /authelia/api/verify; ## Set the $target_url variable based on the original request. set_escape_uri $target_url $scheme://$http_host$request_uri; -## Save the upstream response headers from Authelia to variables. +## Save the upstream authorization response headers from Authelia to variables. +auth_request_set $authorization $upstream_http_authorization; +auth_request_set $proxy_authorization $upstream_http_proxy_authorization; + +## Inject the authorization response headers from the variables into the request made to the backend. +proxy_set_header Authorization $authorization; +proxy_set_header Proxy-Authorization $proxy_authorization; + +## Save the upstream metadata response headers from Authelia to variables. auth_request_set $user $upstream_http_remote_user; auth_request_set $groups $upstream_http_remote_groups; auth_request_set $name $upstream_http_remote_name; auth_request_set $email $upstream_http_remote_email; -## Inject the response headers from the variables into the request made to the backend. +## Inject the metadata response headers from the variables into the request made to the backend. proxy_set_header Remote-User $user; proxy_set_header Remote-Groups $groups; proxy_set_header Remote-Name $name; proxy_set_header Remote-Email $email; +## Include the Set-Cookie header if present. +auth_request_set $set_cookie $upstream_http_set_cookie; +add_header Set-Cookie $set_cookie; + ## Set $authelia_backend to route requests to the current domain by default set $authelia_backend $http_host; ## In order for Webauthn to work with multiple subdomains Authelia must operate on a separate subdomain