Skip to content

[Q&A] Response streaming fail 自部署流式返回失效 #531

Discussion options

You must be logged in to vote

@zhuozhiyongde

试下这个配置

proxy_cache off;  # 关闭缓存
proxy_buffering off;  # 关闭代理缓冲
chunked_transfer_encoding on;  # 开启分块传输编码
tcp_nopush on;  # 开启TCP NOPUSH选项,禁止Nagle算法
tcp_nodelay on;  # 开启TCP NODELAY选项,禁止延迟ACK算法
keepalive_timeout 300;  # 设定keep-alive超时时间为65秒

!这个对我有效,感谢大佬

完整配置如下:

location ^~ / {
    proxy_pass http://127.0.0.1:3210; 
    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 REMOTE-HOST $remote_addr; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection "upgrade"; 
    proxy_http_version 1.1; 
    add_header Cache-Control no-cache; 
    proxy_cache

Replies: 21 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@canisminor1990
Comment options

@BQQQQB
Comment options

Answer selected by canisminor1990
Comment options

You must be logged in to vote
5 replies
@arvinxx
Comment options

@sctm002
Comment options

@sctm002
Comment options

@arvinxx
Comment options

@sctm002
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@arvinxx
Comment options

@CoREse
Comment options

Comment options

You must be logged in to vote
1 reply
@summerKK
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants
Converted from issue

This discussion was converted from issue #528 on November 30, 2023 13:49.