## 新功能 - OCRmyPDF 轉換引擎:將掃描版 PDF 轉換為可搜尋 PDF - 支援 7 種語言:en, zh-TW, zh, ja, ko, de, fr - 與 PDFMathTranslate 風格一致的 UI 格式 (pdf-<lang>) - 自動偵測頁面方向並旋轉 - 自動校正傾斜 - 跳過已有文字層的頁面 - 詳細的 5 階段處理進度輸出 ## 建置 - Dockerfile:安裝 ocrmypdf 與 Tesseract OCR 語言包 ## 文件 - 更新 OCR 功能文件 - 文件目錄結構改為中文名稱 ## 測試 - 修復 BabelDOC 和 PDFMathTranslate 測試的 OCR mock - 所有 345 個測試通過
71 lines
2.1 KiB
Text
71 lines
2.1 KiB
Text
# ConvertX-CN Nginx 反向代理配置範例
|
||
# 檔案位置:/etc/nginx/sites-available/convertx
|
||
|
||
# HTTP → HTTPS 重導向
|
||
server {
|
||
listen 80;
|
||
listen [::]:80;
|
||
server_name convertx.example.com;
|
||
|
||
# Let's Encrypt 驗證
|
||
location /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
}
|
||
|
||
# 重導向到 HTTPS
|
||
location / {
|
||
return 301 https://$server_name$request_uri;
|
||
}
|
||
}
|
||
|
||
# HTTPS 伺服器
|
||
server {
|
||
listen 443 ssl http2;
|
||
listen [::]:443 ssl http2;
|
||
server_name convertx.example.com;
|
||
|
||
# SSL 憑證(Let's Encrypt)
|
||
ssl_certificate /etc/letsencrypt/live/convertx.example.com/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/convertx.example.com/privkey.pem;
|
||
|
||
# SSL 設定(安全強化)
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_prefer_server_ciphers on;
|
||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
||
ssl_session_cache shared:SSL:10m;
|
||
ssl_session_timeout 10m;
|
||
|
||
# 安全 Headers
|
||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||
add_header X-Content-Type-Options nosniff;
|
||
add_header X-Frame-Options DENY;
|
||
add_header X-XSS-Protection "1; mode=block";
|
||
|
||
# 檔案上傳大小限制(依需求調整)
|
||
client_max_body_size 500M;
|
||
|
||
# 上傳超時設定(大檔案需要)
|
||
proxy_connect_timeout 300s;
|
||
proxy_send_timeout 300s;
|
||
proxy_read_timeout 300s;
|
||
|
||
# 主要位置
|
||
location / {
|
||
proxy_pass http://127.0.0.1:3000;
|
||
proxy_http_version 1.1;
|
||
|
||
# 必要的 Headers
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
||
# WebSocket 支援
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection "upgrade";
|
||
|
||
# 緩衝設定
|
||
proxy_buffering off;
|
||
proxy_request_buffering off;
|
||
}
|
||
}
|