diff --git a/config/include/auth.conf b/config/include/auth.conf new file mode 100644 index 0000000..e73bf42 --- /dev/null +++ b/config/include/auth.conf @@ -0,0 +1,5 @@ + auth_request /auth; + auth_request_set $auth_cookie $upstream_http_set_cookie; + add_header Set-Cookie $auth_cookie; + auth_request_set $Authorization $upstream_http_Authorization; + proxy_set_header Authorization $Authorization; \ No newline at end of file diff --git a/config/nginx.auth.conf b/config/nginx.auth.conf index ca53c01..c1ea9fb 100644 --- a/config/nginx.auth.conf +++ b/config/nginx.auth.conf @@ -60,12 +60,9 @@ server { proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; + + include /etc/nginx/include/auth.conf; - auth_request /auth; - auth_request_set $auth_cookie $upstream_http_set_cookie; - add_header Set-Cookie $auth_cookie; - auth_request_set $Authorization $upstream_http_Authorization; - proxy_set_header Authorization $Authorization; } location = /health {