fix(pdfjs): ensure correct MIME type for PDF.js worker files
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user