AIGC/nginx_fix.conf

19 lines
629 B
Plaintext
Raw Permalink Normal View History

2026-02-27 14:37:19 +08:00
# 修改后的 /api/ location 配置
# 将这段替换到你的 nginx.conf 中
location /api/ {
# 修改端口20003 -> 20006
proxy_pass http://120.24.227.27:20006/api/;
# 关键配置:传递请求头,避免后端识别异常
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; # 告诉后端请求是HTTPS过来的
# 超时配置(已经正确,保持不变)
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}