proxyAuth: allow protecting specific subpath

while I don't think this is useful for apps, it is useful for e2e test atleast
This commit is contained in:
Girish Ramakrishnan
2020-11-20 18:13:23 -08:00
parent 71648d92ae
commit d331597bff
3 changed files with 13 additions and 8 deletions

View File

@@ -238,11 +238,18 @@ server {
index index.html index.htm;
}
<% } else if ( endpoint === 'app' ) { %>
location = /appstatus.html {
}
<% if (proxyAuth.enabled) { %>
location "<%= proxyAuth.path %>" {
auth_request /proxy-auth;
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;
error_page 401 = @proxy-auth-login;
proxy_pass http://<%= ip %>:<%= port %>;
}
<% } %>
<% Object.keys(httpPaths).forEach(function (path) { -%>
@@ -251,9 +258,6 @@ server {
}
<% }); %>
location = /appstatus.html {
}
proxy_pass http://<%= ip %>:<%= port %>;
<% } else if ( endpoint === 'redirect' ) { %>
# redirect everything to the app. this is temporary because there is no way