fix: PDF okuma — nginx .mjs worker dosyasını octet-stream sunuyordu, tarayıcı worker'ı reddediyordu

pdfjs worker'ı Vite tarafından pdf.worker.min-<hash>.mjs olarak üretiliyor.
Debian nginx'in mime.types dosyasında mjs uzantısı olmadığından dosya
application/octet-stream ile geliyor; tarayıcılar modül worker'ını yalnızca
JavaScript MIME tipiyle yüklediği için her PDF yüklemesinde
"Setting up fake worker failed: Failed to fetch dynamically imported module"
hatası çıkıyor, belge analizi tamamlanamıyordu. mjs → application/javascript
eşlemesi eklendi (nginx -t ile doğrulandı).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-06 01:02:04 +03:00
co-authored by Claude Fable 5.1
parent 2271883be4
commit 3a0403f07f
+6
View File
@@ -6,6 +6,12 @@ server {
index index.html; index index.html;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
# Vite, pdf.js worker'ını .mjs uzantısıyla üretiyor; Debian'ın mime.types
# dosyasında mjs yok → application/octet-stream sunuluyordu ve tarayıcı
# modül worker'ını yüklemeyi reddediyordu ("Setting up fake worker failed").
types {
application/javascript mjs;
}
# Canlı veri backend'i (aynı container'da Node, port 3001) # Canlı veri backend'i (aynı container'da Node, port 3001)
location /api/ { location /api/ {