前几天搭了一下chatGPT服务器 调用官网API,测试的时候都正常加了域名配置之后,发现流式输出不显示了,找了一下资料,需要再conf配置里面加入以下代码
proxy_buffering off;
proxy_http_version 1.1;
chunked_transfer_encoding on;
server {
listen 80;
server_name xxxxxxx;
location / {
proxy_buffering off; # 关闭响应缓存
proxy_http_version 1.1;
chunked_transfer_encoding on;
proxy_pass http://127.0.0.1:3000/;
}
}