VNOX-Web/docs/nginx-static.conf

34 lines
1.6 KiB
Text

# Merge into the existing HTTPS server block; preserve certificates, ACME and auth proxy.
# Set this to the immutable website release selected by the deployment symlink.
root /opt/vnox-central/web/current;
index index.html;
# Keep the existing /v1/auth/ location ABOVE the generic API location.
# OAuth callback code/state must never be written to access/error logs.
location ^~ /v1/auth/ {
access_log off;
error_log /dev/null;
proxy_pass http://127.0.0.1:37623;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ^~ /v1/ {
proxy_pass http://127.0.0.1:37623;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
}
# Preserve the existing exact /health, /ready and /version proxy locations.
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Frame-Options "DENY" always;
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' https://avatars.githubusercontent.com; connect-src 'self'; font-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; object-src 'none'" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
}
# No OAuth credentials, session keys, SMTP configuration or .env files belong in this root.
# dist/assets includes both vnox-mark.svg and vnox-mark.png, also used by Hub emails.