Fix imported PDFs not rendering in the Docker image

nginx has no MIME type for .mjs, so the pdf.js worker was served as
application/octet-stream and browsers refused to load it. Every imported
PDF page then showed "Source PDF ... is not available", which looked like
missing files. Serve .mjs as text/javascript.

The page background now also tells the two failures apart: "not stored on
this device" when the source bytes are missing, and "could not display"
(with the error logged) when pdf.js fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsorPV3JeJRoZ1mD1pdvtL
This commit is contained in:
agent 2026-09-27 09:37:15 +00:00
parent 24ebbd9056
commit 5d5d86c533
3 changed files with 24 additions and 9 deletions

View file

@ -1,3 +1,9 @@
# This file is included at http level, so this adds to nginx's MIME table.
# Browsers refuse to run module scripts (the pdf.js worker) served as octet-stream.
types {
text/javascript mjs;
}
server {
listen 80;
server_name _;