fix(#188): bot_qa 审核修正——nginx 改无 URI proxy_pass 真透传 + 健康探针 /health 无前缀
打回问题 1:proxy_pass 带末尾 / 是去前缀语义(与声称相反),/v1/models 会被转发成 /models 导致 404。改为不带 URI 的 proxy_pass(无末尾 /), 请求 URI 原样透传;另新增 location = /health 精确透传健康探针。 打回问题 2:serve.py 健康路由是 GET /health(无 /v1 前缀),fetchHealth 由 /v1/health 改回 /health;同步修正 chat/NlQuery/cockpit 三处文案注释。 构建验证:pnpm --filter @vben/web-antdv-next build 通过(10.3s)。
This commit is contained in:
@@ -68,13 +68,18 @@ location /fba-admin/ {
|
||||
# =============================================================================
|
||||
# 推理通道(iAOP LLM 网关)
|
||||
#
|
||||
# issue #188:推理服务真实路径即 :30800/v1/*(/v1/models、/v1/chat/completions、
|
||||
# /v1/health),故 nginx 反代 /v1/ 时 proxy_pass 带 / —— 不去前缀,直接透传,
|
||||
# 消除前端「拼出 /v1/v1 靠 rewrite 巧合耦合」的隐式依赖。
|
||||
# 前端 infer.ts BASE_URL 为空串,统一写 /v1/models、/v1/chat/completions、/v1/health。
|
||||
# issue #188(bot_qa 审核修正):推理服务真实路径为
|
||||
# POST /v1/chat/completions、GET /v1/models(带 /v1 前缀)
|
||||
# GET /health(健康探针,**无 /v1 前缀**,见 deploy/k8s/docker/serve.py)
|
||||
#
|
||||
# 注意 nginx 语义:proxy_pass 带 URI 部分(含末尾 /)时会把 location 匹配
|
||||
# 前缀**替换**掉(即"去前缀",同上方 /fba/ 块用法);要"原样透传"必须
|
||||
# 使用不带 URI 的 proxy_pass(无末尾 /),请求 URI 完整转发给后端。
|
||||
# 前端 infer.ts BASE_URL 为空串,统一写 /v1/models、/v1/chat/completions、/health。
|
||||
# =============================================================================
|
||||
location /v1/ {
|
||||
proxy_pass http://127.0.0.1:30800/;
|
||||
# 不带 URI(无末尾 /):/v1/models → :30800/v1/models 原样透传
|
||||
proxy_pass http://127.0.0.1:30800;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -84,3 +89,13 @@ location /v1/ {
|
||||
client_max_body_size 20m;
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
# 健康探针无前缀,单独精确透传:/health → :30800/health
|
||||
location = /health {
|
||||
proxy_pass http://127.0.0.1:30800;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user