Move wkd nginx configuration to a separate template

This commit is contained in:
David Duque 2021-02-11 23:19:58 +00:00
parent 4e6aa8f0d2
commit 06d210fdc3
No known key found for this signature in database
GPG key ID: 2F327738A3C0AE3A
2 changed files with 15 additions and 14 deletions

View file

@ -0,0 +1,15 @@
# ADDITIONAL DIRECTIVES HERE
# WKD Locations
location ~ ^/.well-known/openpgpkey/(?<domain>.+)/policy$ {
add_header Access-Control-Allow-origin * always;
if (-d /var/lib/mailinabox/wkd/$domain/) {
return 204;
}
return 404;
}
location ~ ^/.well-known/openpgpkey/(?<domain>.+)/hu/(?<keyid>[ybndrfg8ejkmcpqxot1uwisza345h769]+)$ {
add_header Access-Control-Allow-Origin * always;
alias /var/lib/mailinabox/wkd/$domain/$keyid;
}

View file

@ -98,17 +98,3 @@
rewrite ^/.well-known/host-meta.json /cloud/public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /cloud/remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /cloud/remote.php/caldav/ redirect;
# WKD Locations
location ~ ^/.well-known/openpgpkey/(?<domain>.+)/policy$ {
add_header Access-Control-Allow-origin * always;
if (-d /var/lib/mailinabox/wkd/$domain/) {
return 204;
}
return 404;
}
location ~ ^/.well-known/openpgpkey/(?<domain>.+)/hu/(?<keyid>[ybndrfg8ejkmcpqxot1uwisza345h769]+)$ {
add_header Access-Control-Allow-Origin * always;
alias /var/lib/mailinabox/wkd/$domain/$keyid;
}