Files
gangyan/scripts/tools-nginx.conf

134 lines
3.8 KiB
Plaintext
Raw Normal View History

server {
listen 18000;
client_max_body_size 500M;
# 1. Stirling PDF
location /pdf/ {
proxy_pass http://127.0.0.1:18080/;
proxy_set_header Host $host;
proxy_set_header Accept-Encoding "";
proxy_buffering off;
sub_filter_once off;
sub_filter '"/api/' '"/pdf-api/';
}
location /pdf-api/ {
proxy_pass http://127.0.0.1:18080/api/;
proxy_set_header Host $host;
proxy_buffering off;
client_max_body_size 500M;
}
# 2. Excalidraw
location /draw/ {
proxy_pass http://127.0.0.1:18081/;
proxy_set_header Host $host;
}
location /assets/ { proxy_pass http://127.0.0.1:18081/assets/; }
location /v1/ai/ {
proxy_pass http://127.0.0.1:18082/v1/ai/;
proxy_set_header Host $host;
proxy_read_timeout 60s;
proxy_buffering off;
}
# 3. TrWebOCR
location /ocr/ {
proxy_pass http://127.0.0.1:18083/;
proxy_set_header Host $host;
proxy_buffering off;
}
# 4. LibreTranslate
location /translate/ {
proxy_pass http://127.0.0.1:18084/;
proxy_set_header Host $host;
}
# 5. PPTist
location /ppt/ {
proxy_pass http://127.0.0.1:18085/;
proxy_set_header Host $host;
proxy_buffering off;
}
location /pptapi/ {
proxy_pass http://127.0.0.1:18086/;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
}
# 6. imgcompress
location /imgcompress/ {
proxy_pass http://127.0.0.1:18087/;
proxy_set_header Host $host;
}
# 7. Lama Cleaner
location /lama/ {
proxy_pass http://127.0.0.1:18088/;
proxy_set_header Host $host;
proxy_buffering off;
}
location /lama/inpaint {
proxy_pass http://127.0.0.1:18088/inpaint;
proxy_set_header Host $host;
proxy_buffering off;
proxy_read_timeout 300s;
client_max_body_size 500M;
}
# Lama Cleaner 的2个精确static文件
location /static/js/main.1bd455bc.js { proxy_pass http://127.0.0.1:18088/static/js/main.1bd455bc.js; }
location /static/css/main.c28d98ca.css { proxy_pass http://127.0.0.1:18088/static/css/main.c28d98ca.css; }
# /static/ 其余的给 LibreTranslate
location /static/ { proxy_pass http://127.0.0.1:18084/static/; }
# LibreTranslate 绝对路径 API
location /languages { proxy_pass http://127.0.0.1:18084/languages; }
location /frontend/settings { proxy_pass http://127.0.0.1:18084/frontend/settings; }
location /detect { proxy_pass http://127.0.0.1:18084/detect; }
# imgcompress 绝对路径
location /_next/ { proxy_pass http://127.0.0.1:18087/_next/; }
location /api/ {
proxy_pass http://127.0.0.1:18087/api/;
proxy_set_header Host $host;
proxy_buffering off;
client_max_body_size 500M;
}
# 8. webp2jpg
location /webp2jpg/ {
proxy_pass http://127.0.0.1:18089/;
proxy_set_header Host $host;
}
location /cdn/ { proxy_pass http://127.0.0.1:18089/cdn/; }
# 9. Overleaf
location /overleaf/ {
proxy_pass http://127.0.0.1:18090/;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
}
# 10. LaTeX 公式编辑器
location /latex/ {
proxy_pass http://127.0.0.1:18091/;
proxy_set_header Host $host;
}
# 默认回落到 Overleaf
location / {
proxy_pass http://127.0.0.1:18090;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
}
}