From 0a1be376ebd1a4e5c7ddd9ba3cdba3142fc6d74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D1=8F=20=D0=90=D1=80=D1=85=D0=B8=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 30 Jul 2026 12:16:49 +0000 Subject: [PATCH] fix: restore default nginx MIME types so HTML/JS are not downloaded A server-level types{} block replaced mime.types, so index/JS were served as application/octet-stream; with nosniff the browser saved them as files. Co-authored-by: Cursor --- nginx.conf | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index f464e96..68e3c6f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,6 +4,11 @@ server { root /usr/share/nginx/html; index index.html; + # Keep default MIME map (html/js/css). Do NOT put a server-level `types {}` + # here — it replaces mime.types and forces downloads (octet-stream + nosniff). + include /etc/nginx/mime.types; + default_type application/octet-stream; + # Security headers (Stage 2B §24.3) add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "DENY" always; @@ -15,13 +20,7 @@ server { gzip_vary on; gzip_min_length 1024; gzip_comp_level 6; - gzip_types text/plain text/css application/json application/javascript image/svg+xml; - - # Explicit 3D model MIME types - types { - model/gltf-binary glb; - model/stl stl; - } + gzip_types text/plain text/css application/json application/javascript text/javascript image/svg+xml; location = /version.json { add_header Cache-Control "no-store, no-cache, must-revalidate"; @@ -38,7 +37,14 @@ server { add_header Cache-Control "public, immutable"; } + # 3D models only — scoped types override (does not wipe html/js MIME) location /models/ { + types { + model/gltf-binary glb; + model/stl stl; + application/octet-stream bin; + } + default_type application/octet-stream; expires 1y; add_header Cache-Control "public, immutable"; }