Add public nginx endpoints for WKD

This commit is contained in:
David Duque 2020-12-20 23:11:28 +00:00
parent 6a08551402
commit 9be5d2b454
No known key found for this signature in database
GPG key ID: 2F327738A3C0AE3A

View file

@ -1,5 +1,5 @@
# ADDITIONAL DIRECTIVES HERE
# Control Panel
# Proxy /admin to our Python based control panel daemon. It is
# listening on IPv4 only so use an IP address and not 'localhost'.
@ -98,3 +98,17 @@
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;
}