1
0
Fork 0
mirror of https://gitlab.com/hagrid-keyserver/hagrid.git synced 2023-02-13 20:55:02 -05:00

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

View file

@ -27,17 +27,22 @@ http {
} }
location /by-fingerprint/ { location /by-fingerprint/ {
rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ $2/$3 break; rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ /by-fingerprint/$2$3 break;
default_type application/pgp-keys; default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"'; 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/ { 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; default_type application/pgp-keys;
add_header Content-Disposition 'attachment; filename="$2$3.asc"'; 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. # Common HKP requests.