From 937d3c3fa6290084346a8aa798166c912736fc81 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 13 Nov 2023 18:31:17 +0100 Subject: add role nginx/auth/whawty-sso --- .../auth/whawty-sso/base/templates/nginx.snippet.j2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 roles/nginx/auth/whawty-sso/base/templates/nginx.snippet.j2 (limited to 'roles/nginx/auth/whawty-sso/base/templates/nginx.snippet.j2') diff --git a/roles/nginx/auth/whawty-sso/base/templates/nginx.snippet.j2 b/roles/nginx/auth/whawty-sso/base/templates/nginx.snippet.j2 new file mode 100644 index 00000000..f8f67c45 --- /dev/null +++ b/roles/nginx/auth/whawty-sso/base/templates/nginx.snippet.j2 @@ -0,0 +1,19 @@ +auth_request /auth; +error_page 401 = @error401; + +location /auth { + internal; + + proxy_pass 127.0.0.1:{{ item.value.port }}/auth; + proxy_pass_request_body off; + proxy_set_header Content-Length ""; + proxy_set_header X-Origin-URI $request_uri; + proxy_set_header X-Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; +} + +location @error401 { + return 302 {{ item.value.login_url }}?redir=$scheme://$http_host$request_uri; +} -- cgit v1.2.3