diff --git a/src/nginxconfig.ejs b/src/nginxconfig.ejs index 93939991a..5487a7217 100644 --- a/src/nginxconfig.ejs +++ b/src/nginxconfig.ejs @@ -119,12 +119,14 @@ server { add_header Referrer-Policy $hrp; proxy_hide_header Referrer-Policy; + <% if (proxyAuth.enabled) { %> # workaround caching issue after /logout. if max-age is set, browser uses cache and user thinks they have not logged out # have to keep all the add_header here to avoid repeating all add_header in location block - <% if (proxyAuth.enabled) { %> proxy_hide_header Cache-Control; add_header Cache-Control no-cache; add_header Set-Cookie $auth_cookie; + + proxy_set_header X-App-ID "<%= proxyAuth.id %>"; <% } %> # gzip responses that are > 50k and not images @@ -194,10 +196,6 @@ server { proxy_pass http://127.0.0.1:3000/well-known-handler/; } -<% if (proxyAuth.enabled) { %> - proxy_set_header X-App-ID "<%= proxyAuth.id %>"; -<% } %> - # increase the proxy buffer sizes to not run into buffer issues (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers) proxy_buffer_size 128k; proxy_buffers 4 256k;