Files
private_image/nginx/snippets/private-image-locations.conf.template
T
nobswebdev adb1d7bca9 Fix Onion-Location on SPA responses behind nginx add_header.
Render the header inside location / so it is not dropped by other location headers; remove the ineffective server-level directive.
2026-10-28 23:12:08 +01:00

51 lines
1.3 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 / {
${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;
}