fix(pdfjs): ensure correct MIME type for PDF.js worker files

This commit is contained in:
2025-11-17 13:35:37 +08:00
parent 11d2bf228a
commit fd640631fc
4 changed files with 46 additions and 4 deletions

View File

@@ -64,6 +64,12 @@ server {
try_files \$uri \$uri/ ${RAGFLOW_BASE}index.html;
}
# 为 pdfjs worker 提供正确的 Content-Type避免 .mjs 被当作 application/octet-stream
location ^~ /pdfjs-dist/ {
# 统一按 application/javascript 返回,确保浏览器可作为模块脚本加载
default_type application/javascript;
}
# 静态资源缓存
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;