The streaming response failed after using the domain name #8728

Closed
opened 2026-02-21 18:27:16 -05:00 by yindo · 3 comments
Owner

Originally created by @dashing9527 on GitHub (Feb 27, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_read_timeout ${NGINX_PROXY_READ_TIMEOUT};
proxy_send_timeout ${NGINX_PROXY_SEND_TIMEOUT};
proxy_set_header X-Accel-Buffering no;
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秒`

### ✔️ Expected Behavior

Stream response, real-time response

### ❌ Actual Behavior

There's a blockage. There's a holdup
Originally created by @dashing9527 on GitHub (Feb 27, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/5309f5d4-a0b5-4bbf-a7cb-ed51714fd230) ```proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_read_timeout ${NGINX_PROXY_READ_TIMEOUT}; proxy_send_timeout ${NGINX_PROXY_SEND_TIMEOUT}; proxy_set_header X-Accel-Buffering no; 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秒` ### ✔️ Expected Behavior Stream response, real-time response ### ❌ Actual Behavior There's a blockage. There's a holdup
yindo added the 🐞 bug label 2026-02-21 18:27:16 -05:00
yindo closed this issue 2026-02-21 18:27:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2025):

I found a similar issue related to streaming responses in Dify version 0.15.3. The known problem is that the stream response output can suddenly stop when using a knowledge base combined with LLM. To address this, you should configure certain timeout environment variables in your .env file, such as SSRF_DEFAULT_TIME_OUT, SSRF_DEFAULT_CONNECT_TIME_OUT, SSRF_DEFAULT_READ_TIME_OUT, SSRF_DEFAULT_WRITE_TIME_OUT, HTTP_REQUEST_MAX_CONNECT_TIMEOUT, HTTP_REQUEST_MAX_READ_TIMEOUT, and HTTP_REQUEST_MAX_WRITE_TIMEOUT. Additionally, check the max token or num predict settings in your LLM node configuration [1].

Your proxy configuration seems to be set up to handle streaming, but you might want to ensure that the timeout settings in your environment are correctly configured as mentioned above.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 27, 2025): <!-- Answer --> I found a similar issue related to streaming responses in Dify version 0.15.3. The known problem is that the stream response output can suddenly stop when using a knowledge base combined with LLM. To address this, you should configure certain timeout environment variables in your `.env` file, such as `SSRF_DEFAULT_TIME_OUT`, `SSRF_DEFAULT_CONNECT_TIME_OUT`, `SSRF_DEFAULT_READ_TIME_OUT`, `SSRF_DEFAULT_WRITE_TIME_OUT`, `HTTP_REQUEST_MAX_CONNECT_TIMEOUT`, `HTTP_REQUEST_MAX_READ_TIMEOUT`, and `HTTP_REQUEST_MAX_WRITE_TIMEOUT`. Additionally, check the max token or num predict settings in your LLM node configuration <sup>[[1]](https://github.com/langgenius/dify/issues/14416)</sup>. Your proxy configuration seems to be set up to handle streaming, but you might want to ensure that the timeout settings in your environment are correctly configured as mentioned above. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/17234310-a9cf-4330-836e-91f123927822?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 27, 2025):

Check the nginx settings. Try to set keepalive_timeout longer.

@crazywoola commented on GitHub (Feb 27, 2025): Check the nginx settings. Try to set `keepalive_timeout ` longer.
Author
Owner

@killerddd3 commented on GitHub (Mar 3, 2025):

same here

@killerddd3 commented on GitHub (Mar 3, 2025): same here
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8728