Pass failing /by-* queries to hagrid for normalization.

This commit is contained in:
Justus Winter 2019-02-26 13:56:47 +01:00
parent 7123c884bb
commit 6e84a51310
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
1 changed files with 9 additions and 4 deletions

View File

@ -27,17 +27,22 @@ http {
}
location /by-fingerprint/ {
rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ $2/$3 break;
rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ /by-fingerprint/$2$3 break;
default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"';
try_files /by-fpr/$uri =404;
try_files /by-fpr/$2/$3 @fallback;
}
location /by-keyid/ {
rewrite ^/by-keyid/(0x)?([^/][^/])(.*)$ /by-keyid/$2/$3 break;
rewrite ^/by-keyid/(0x)?([^/][^/])(.*)$ /by-keyid/$2$3 break;
default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"';
try_files /$uri =404;
try_files /by-keyid/$2/$3 @fallback;
}
# Pass queries that we do not understand to hagrid.
location @fallback {
proxy_pass http://127.0.0.1:8080;
}
# Common HKP requests.