From cf93e663917664c655c94dc4b3d1772932d5da9e Mon Sep 17 00:00:00 2001 From: James Elliott Date: Sun, 10 Apr 2022 08:05:27 +1000 Subject: [PATCH] test(suites): fix backend endpoints (#3158) --- .../example/compose/nginx/portal/nginx.conf | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/internal/suites/example/compose/nginx/portal/nginx.conf b/internal/suites/example/compose/nginx/portal/nginx.conf index 1b87495ff..5d7e4f641 100644 --- a/internal/suites/example/compose/nginx/portal/nginx.conf +++ b/internal/suites/example/compose/nginx/portal/nginx.conf @@ -45,7 +45,43 @@ http { proxy_pass $backend_endpoint; } - location /.well-known/openid-configuration { + location /.well-known { + # Required by Authelia because "trust proxy" option is used. + # See https://expressjs.com/en/guide/behind-proxies.html + proxy_set_header X-Forwarded-Proto $scheme; + + # Required by Authelia to build correct links for identity validation. + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Forwarded-URI $request_uri; + + # Needed for network ACLs to work. It appends the IP of the client to the list of IPs + # and allows Authelia to use it to match the network-based ACLs. + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_intercept_errors on; + + proxy_pass $backend_endpoint; + } + + location /locales { + # Required by Authelia because "trust proxy" option is used. + # See https://expressjs.com/en/guide/behind-proxies.html + proxy_set_header X-Forwarded-Proto $scheme; + + # Required by Authelia to build correct links for identity validation. + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Forwarded-URI $request_uri; + + # Needed for network ACLs to work. It appends the IP of the client to the list of IPs + # and allows Authelia to use it to match the network-based ACLs. + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_intercept_errors on; + + proxy_pass $backend_endpoint; + } + + location /jwks.json { # Required by Authelia because "trust proxy" option is used. # See https://expressjs.com/en/guide/behind-proxies.html proxy_set_header X-Forwarded-Proto $scheme; @@ -333,4 +369,3 @@ http { return 301 https://home.example.com:8080/; } } -