Files
BeamMP-Website/nginx.conf
Starystars67 b2742428d0 Test
2026-04-02 03:09:16 +01:00

35 lines
1.2 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
server_tokens off;
root /usr/share/nginx/html;
index index.html;
# Baseline security hardening for a static SPA.
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data: https:; script-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' https://backend.beammp.com; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always;
location ^~ /installer/ {
#try_files $uri =404;
try_files $uri $uri/ /index.html;
}
location / {
# SPA fallback: serve index.html for non-file routes so Vue Router can render NotFound
try_files $uri $uri/ /index.html;
}
# Let real 404s for assets return 404s; Vue handles route-level 404 via the SPA fallback above.
location /static/ {
# Serve static files directly
expires max;
access_log off;
}
}