From 60cf932aa01922410434642dea26db1b816a806a Mon Sep 17 00:00:00 2001 From: khondokartowsif171 Date: Mon, 27 Apr 2026 18:13:05 +0600 Subject: [PATCH] fix: serve .jsx files as application/javascript for Babel standalone --- nginx.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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;