mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-06 00:23:08 +02:00
handle more errors in nginx
This commit is contained in:
@@ -21,33 +21,32 @@ location /keys {
|
|||||||
|
|
||||||
location /vks/v1/ {
|
location /vks/v1/ {
|
||||||
location ~ ^/vks/v1/by-email/([^/][^/])([^/][^/])([^/]*)$ {
|
location ~ ^/vks/v1/by-email/([^/][^/])([^/][^/])([^/]*)$ {
|
||||||
|
error_page 404 /errors/404-by-email.htm;
|
||||||
default_type application/pgp-keys;
|
default_type application/pgp-keys;
|
||||||
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
try_files /keys/links/by-email/$1/$2/$3 @fallback;
|
try_files /keys/links/by-email/$1/$2/$3 =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/vks/v1/by-fingerprint/(?:0x)?([^/][^/])([^/][^/])(..*)$ {
|
location ~ ^/vks/v1/by-fingerprint/(?:0x)?([^/][^/])([^/][^/])(..*)$ {
|
||||||
|
error_page 404 /errors/404-by-fpr.htm;
|
||||||
default_type application/pgp-keys;
|
default_type application/pgp-keys;
|
||||||
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
try_files /keys/links/by-fpr/$1/$2/$3 @fallback;
|
try_files /keys/links/by-fpr/$1/$2/$3 =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/vks/v1/by-keyid/(?:0x)?([^/][^/])([^/][^/])(.*)$ {
|
location ~ ^/vks/v1/by-keyid/(?:0x)?([^/][^/])([^/][^/])(.*)$ {
|
||||||
|
error_page 404 /errors/404-by-keyid.htm;
|
||||||
default_type application/pgp-keys;
|
default_type application/pgp-keys;
|
||||||
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
add_header Content-Disposition 'attachment; filename="$1$2$3.asc"';
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
try_files /keys/links/by-keyid/$1/$2/$3 @fallback;
|
try_files /keys/links/by-keyid/$1/$2/$3 =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pass queries that we do not understand to hagrid.
|
|
||||||
location @fallback {
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
proxy_pass http://127.0.0.1:8080;
|
error_page 400 /errors/400-vks-invalid.htm;
|
||||||
|
return 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Common HKP requests.
|
# Common HKP requests.
|
||||||
|
Reference in New Issue
Block a user