From 96dd20e06bdb63bbd523f8db073076b4e5694ead Mon Sep 17 00:00:00 2001 From: Kenneth Obsequio Date: Tue, 22 Sep 2026 12:51:27 +0800 Subject: [PATCH] refactor: nginx config Signed-off-by: Kenneth Obsequio --- apps/web/nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/web/nginx.conf b/apps/web/nginx.conf index 9ee4493..58d7a76 100644 --- a/apps/web/nginx.conf +++ b/apps/web/nginx.conf @@ -10,6 +10,16 @@ server { try_files $uri $uri/ /index.html; } + # pdfjs-dist ships its worker as an ES module. Firefox rejects a module + # worker when nginx falls back to application/octet-stream for .mjs. + location ~* \.mjs$ { + types { + application/javascript mjs; + } + expires 1y; + add_header Cache-Control "public, immutable"; + } + # Cache hashed assets aggressively location ~* \.(js|css|woff2?|ttf|svg|ico|png|jpg|jpeg|webp|gif)$ { expires 1y;