fix(nginx): 将原生模型接口转发至 API

生产同构 Gemini 验收发现 /v1beta 请求被 Web 入口返回 405,导致请求在到达 Worker 前全部失败。补齐 /v1 和 /v1beta 原生兼容路由,沿用 API 的长请求超时、无缓冲和双上游故障切换配置。\n\n验证:使用 nginx:1.27-alpine 对完整站点配置执行 nginx -t 通过。
This commit is contained in:
2026-07-31 01:03:51 +08:00
parent 3b67038660
commit cd9c8d56ab
+20
View File
@@ -56,6 +56,26 @@ server {
proxy_pass http://easyai_gateway_api;
}
# Gemini and OpenAI native compatibility routes are intentionally exposed
# without the /api prefix. Keep them on the API upstream instead of allowing
# the catch-all Web location to return 405 for valid provider requests.
location ~ ^/v1(?:beta)?/ {
proxy_http_version 1.1;
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 https;
proxy_set_header Connection "";
proxy_connect_timeout 2s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
proxy_request_buffering off;
proxy_buffering off;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_next_upstream_tries 2;
proxy_pass http://easyai_gateway_api;
}
location /gateway-api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;