Nginx again

This commit is contained in:
Reece 2025-09-25 15:38:04 +01:00
parent 9be7f9637e
commit 126b4dc1b2

View File

@ -6,6 +6,11 @@ http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
# Add .mjs MIME type mapping
types {
text/javascript mjs;
}
# Gzip compression # Gzip compression
gzip on; gzip on;
gzip_vary on; gzip_vary on;
@ -92,7 +97,8 @@ http {
# Serve .mjs files with correct MIME type (must come before general static assets) # Serve .mjs files with correct MIME type (must come before general static assets)
location ~* \.mjs$ { location ~* \.mjs$ {
add_header Content-Type text/javascript; try_files $uri =404;
add_header Content-Type "text/javascript; charset=utf-8" always;
expires 1y; expires 1y;
add_header Cache-Control "public, immutable"; add_header Cache-Control "public, immutable";
} }