server hardening + deperation to tget the installer served

This commit is contained in:
Starystars67 committed 2026-04-02 02:42:55 +01:00
1 parent 4626a69185
commit a253919575
2 files changed
+28 -3

No files matched your search

+21 -2
View File
@@ -2,11 +2,30 @@ 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/BeamMP_Installer.msi {
default_type application/octet-stream;
add_header Content-Disposition 'attachment; filename="BeamMP_Installer.msi"' always;
add_header Cache-Control "public, max-age=3600" always;
try_files $uri =404;
}
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;
@@ -14,8 +33,8 @@ server {
location ~* \.msi$ {
default_type application/octet-stream;
add_header Content-Disposition 'attachment';
add_header X-Content-Type-Options nosniff;
add_header Content-Disposition 'attachment' always;
add_header X-Content-Type-Options nosniff always;
try_files $uri =404;
}