diff --git a/nginx.conf b/nginx.conf index 98a33f5..a93d2f7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,8 +17,17 @@ server { gzip_min_length 1024; gzip_comp_level 6; - # Cache static assets - location ~* \.(css|js|jsx|woff2?|ttf|svg|png|jpg|jpeg|ico|gif|webp)$ { + # JSX files — force correct MIME type (not in nginx default mime.types) + location ~* \.jsx$ { + types { } + default_type application/javascript; + expires 1d; + add_header Cache-Control "public, must-revalidate"; + try_files $uri =404; + } + + # Cache other static assets + location ~* \.(css|js|woff2?|ttf|svg|png|jpg|jpeg|ico|gif|webp)$ { expires 7d; add_header Cache-Control "public, immutable"; try_files $uri =404;