From 4c10cbdb2fa9c81f10366a36c40c7897e65236c1 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 26 Feb 2019 12:30:42 +0100 Subject: [PATCH] Provide nicer filenames for downloads. - This is especially useful for the HKP interface, where previously all downloads were named 'lookup'. --- nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nginx.conf b/nginx.conf index 6e0182f..0cd91c8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -19,18 +19,21 @@ http { location /by-email/ { rewrite "^/by-email/([^/]{2})([^/]*)$" /by-email/$1/$2 break; default_type application/pgp-keys; + add_header Content-Disposition 'attachment; filename="$1$2.asc"'; try_files /$uri =404; } location /by-fingerprint/ { rewrite ^/by-fingerprint/(0x)?([^/][^/])(..*)$ $2/$3 break; default_type application/pgp-keys; + add_header Content-Disposition 'attachment; filename="$2$3.asc"'; try_files /by-fpr/$uri =404; } location /by-keyid/ { 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; }