wkd: add nginx routes
This commit is contained in:
parent
deb3a0373b
commit
92cb32d36f
|
@ -0,0 +1,2 @@
|
|||
<p><strong>Error 400</strong> Invalid request</p>
|
||||
<p>See https://keys.openpgp.org/about/api</p>
|
|
@ -0,0 +1 @@
|
|||
No key found for this email address.
|
|
@ -93,6 +93,34 @@ location /pks/lookup {
|
|||
return 400;
|
||||
}
|
||||
|
||||
# WKD requests
|
||||
location /.well-known/openpgpkey {
|
||||
etag off;
|
||||
|
||||
location ~ "^/.well-known/openpgpkey/([^/]+)/hu/([^/][^/])([^/][^/])(.*)" {
|
||||
limit_req zone=search_email burst=50 nodelay;
|
||||
error_page 429 /errors-static/429-rate-limit-vks-email.htm;
|
||||
|
||||
error_page 404 /errors-static/404-wkd.htm;
|
||||
default_type application/pgp-keys;
|
||||
add_header Content-Disposition 'attachment; filename="$2$3$4.asc"';
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Cache-Control' 'no-cache';
|
||||
try_files /keys/links/wkd/$1/$2/$3/$4 =404;
|
||||
}
|
||||
|
||||
location = /.well-known/openpgpkey/policy {
|
||||
default_type text/plain;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Cache-Control' 'no-cache';
|
||||
return 200 '';
|
||||
}
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
error_page 400 /errors-static/400-wkd-invalid.htm;
|
||||
return 400;
|
||||
}
|
||||
|
||||
location /pks/internal {
|
||||
internal;
|
||||
|
||||
|
|
Loading…
Reference in New Issue