mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-04-03 06:16:21 +00:00
34 lines
1.1 KiB
Nginx Configuration File
34 lines
1.1 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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
} |