Add hkp and vks support
This commit is contained in:
+25
-13
@@ -1,36 +1,48 @@
|
||||
upstream hagrid_backend {
|
||||
# Verify this matches the selected Hagrid image's internal listen port.
|
||||
server hagrid:8000;
|
||||
keepalive 16;
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
server_tokens off;
|
||||
autoindex off;
|
||||
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
|
||||
location = /healthz {
|
||||
access_log off;
|
||||
default_type text/plain;
|
||||
return 200 "OK\n";
|
||||
}
|
||||
|
||||
# Direct-method Web Key Directory (WKD).
|
||||
# Files live under ./wkd, mounted at /.well-known/openpgpkey/.
|
||||
# Hagrid handles HKP and VKS.
|
||||
location ^~ /pks/ {
|
||||
proxy_pass http://hagrid_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
location ^~ /vks/ {
|
||||
proxy_pass http://hagrid_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
location ^~ /.well-known/openpgpkey/ {
|
||||
limit_except GET HEAD { deny all; }
|
||||
default_type application/octet-stream;
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Optional legacy/static download URLs.
|
||||
location ^~ /keys/ {
|
||||
limit_except GET HEAD { deny all; }
|
||||
default_type application/octet-stream;
|
||||
default_type application/pgp-keys;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
location / { return 404; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user