- deploy/nginx/plantai.conf(新): 80 反代 127.0.0.1:8090 模板,SSE 长连接 (buffering off/read_timeout 3600s>看门狗 1200s)+大文件上传 (client_max_body_size 0/request_buffering off/send_timeout 600s)适配 - 绑定脚本: bff_restart.sh/sdk/run.sh/start-dev.sh 默认 0.0.0.0→127.0.0.1 (nginx 80 为唯一客户入口);build_all.sh start_all heredoc 同改+nginx 模板入包 install/nginx/ - DEPLOY_FLOW.md: §0 绑定策略更新+nginx 模板位置;新增 §5b 从零安装 nginx(apt/yum 探测→放模板→nginx -t→启用→防火墙→先 nginx 后改绑的 切换顺序→内网验证);§6 质检增 nginx 专项(进程/80 监听/经 80 首页+SSE 冒烟+上传冒烟);§7 注明现网仍是 0.0.0.0:8090 直连形态待按 §5b 迁移 纪律: 仅新增与修改,未在目标机/现网执行任何 nginx 安装或改绑操作。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
47 lines
2.1 KiB
Plaintext
47 lines
2.1 KiB
Plaintext
# plantai.conf —— PlantAI-rag-new nginx 反向代理(80 端口唯一客户入口)
|
||
# 用法(目标机):cp 本文件到 nginx conf.d(路径因发行版而异,先 nginx -t 看默认 include 路径),
|
||
# 然后 nginx -t && systemctl reload nginx(或直接启动)。
|
||
# 约定:本模板反代 127.0.0.1:8090(BFF,自托管 ui/dist 静态 + 全部 API)。
|
||
# 其余内部服务(8091 QA / 8092 methodology / 8093 legacy / 8094 vstore / 8098 bioflow)
|
||
# 不对外暴露,nginx 不代理它们。
|
||
# 关键适配(对应系统实际特性,勿删):
|
||
# - SSE 流(/api/qa/chat/stream、/api/bioflow/*):buffering 必须 off、长读超时须大于
|
||
# BFF 看门狗 1200s(本配置 3600s)。
|
||
# - 大文件上传(2026-09-04 起无大小限制;生信基因组数百 MB):client_max_body_size 0、
|
||
# 上传缓冲关、send 超时 ≥ BFF 上传超时 600s。
|
||
server {
|
||
listen 80;
|
||
# server_name 可换成实际域名或内网 IP,如 server_name 192.168.0.175;
|
||
server_name _;
|
||
|
||
# 上传:不限制大小(上传限制在应用层已移除;生信大文件数百 MB)
|
||
client_max_body_size 0;
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:8090;
|
||
|
||
# ---- SSE 长连接适配(问答流/生信流;勿删勿改)----
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Connection "";
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
proxy_read_timeout 3600s; # > BFF SSE 看门狗 1200s
|
||
|
||
# ---- 大文件上传适配(勿删勿改)----
|
||
proxy_request_buffering off;
|
||
proxy_send_timeout 600s; # ≥ BFF 上传读超时 600s
|
||
|
||
# ---- 标准头 ----
|
||
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;
|
||
}
|
||
|
||
# 可选优化:对可压缩类型开启 gzip(后端为浏览器静态与 JSON 响应)
|
||
gzip on;
|
||
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
||
gzip_proxied any;
|
||
gzip_min_length 1024;
|
||
}
|