From b61546a53a6880d4dd35f3de6116816ff03a7c7a Mon Sep 17 00:00:00 2001 From: kathleen Date: Sun, 22 Nov 2026 01:56:37 +0000 Subject: [PATCH] nginx: declare every file type the page serves With X-Content-Type-Options: nosniff a browser refuses a script whose type is not exactly a JavaScript type. Declare the types of every file the site build writes (html, js, json, csv, css, svg, plus yaml/py/md as text) instead of relying on the base image's mime.types, so the page loads whatever that list contains. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ --- deploy/nginx.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 2aaed44..4ff1095 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -18,10 +18,18 @@ server { # The image logs to files under /var/log/nginx; send access logs to the pod log instead access_log /dev/stdout main; - # Show the page's data and source files as text (in server context this replaces the inherited types) + # Every file type the site build writes, declared here rather than left to the image's mime.types: with nosniff + # (below) a browser refuses a script that is not served as JavaScript. The page's data and source files show as + # text. Anything else falls back to the image's list. include /etc/nginx/mime.types; types { - text/plain yaml py; + text/html html; + application/javascript js mjs; + application/json json; + text/csv csv; + text/css css; + image/svg+xml svg; + text/plain yaml py md txt; } gzip on; -- 2.54.0