check .well-known presence upstream

this is required for apps like nextcloud which have caldav/cardav
routes
This commit is contained in:
Girish Ramakrishnan
2020-04-15 16:12:56 -07:00
parent 2fe323e587
commit 7eafa661fe
2 changed files with 16 additions and 3 deletions

View File

@@ -136,10 +136,20 @@ server {
internal;
}
location @wellknown-upstream {
<% if ( endpoint === 'admin' ) { %>
proxy_pass http://127.0.0.1:3000;
<% } else if ( endpoint === 'app' ) { %>
proxy_pass http://127.0.0.1:<%= port %>;
<% } else if ( endpoint === 'redirect' ) { %>
return 302 https://<%= redirectTo %>$request_uri;
<% } %>
}
# user defined .well-known resources
# alias means only the part after matched location is appended (unlike root)
location /.well-known/ {
alias /home/yellowtent/boxdata/well-known/$host/;
location ~ ^/.well-known/(.*)$ {
root /home/yellowtent/boxdata/well-known/$host;
try_files /$1 @wellknown-upstream;
}
location / {