Files
private_image/nginx/snippets/private-image-locations.conf.template
nobswebdev 32cd1bdb9e Precompress ExifTool WASM with Brotli and serve via nginx brotli_static.
Tor first loads drop from ~25 MB raw to ~5 MB on the wire; prod build writes .wasm.br sidecars and Alpine nginx serves them under /assets with long-lived cache.
2026-10-30 23:32:16 +01:00

59 lines
1.5 KiB
Plaintext

location ^~ /i/ {
add_header Content-Security-Policy "sandbox" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Cross-Origin-Resource-Policy "cross-origin" always;
add_header Cache-Control "private, no-store" always;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://backend:${BACKEND_PORT};
}
location /api {
client_max_body_size ${UPLOAD_MAX_REQUEST_BODY_BYTES};
add_header Cache-Control "no-store" always;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_pass http://backend:${BACKEND_PORT};
}
location /pgadmin {
proxy_set_header X-Script-Name /pgadmin;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_pass http://pgadmin;
proxy_redirect off;
}
location ^~ /assets/ {
root /usr/share/nginx/html;
brotli_static on;
add_header Cache-Control "public, max-age=31536000, immutable" always;
}
location / {
${ONION_LOCATION_HEADER}
add_header Referrer-Policy "no-referrer" always;
add_header Cache-Control "no-store" always;
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}