zhizhi/backend-integration/nginx-api-proxy.conf

27 lines
866 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🔌 AGE OS API 代理层 — Nginx 配置参考
#
# 将此配置添加到 guanghulab.com 的 Nginx server block 中,
# 使前端可以通过 /api/* 路径访问后端代理。
#
# 前端GitHub Pages→ Nginx → API 代理Node.js :3721→ 模型 API
# API 代理转发
location /api/ {
proxy_pass http://127.0.0.1:3721;
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 $scheme;
# SSE 流式响应必需
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding on;
# 长连接超时(与 Node.js api-proxy 的 60s 连接超时对齐,流式响应可更长)
proxy_read_timeout 90s;
proxy_send_timeout 60s;
}