diff --git a/nginx.conf b/nginx.conf index 83421d9..a328c12 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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.