dify icon indicating copy to clipboard operation
dify copied to clipboard

Nginx 504 Gateway timeout for operations running more than 30 sec

Open ndrewpj opened this issue 2 months ago • 3 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report, otherwise it will be closed.
  • [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Query a Knowledge base app that uses LLM and using v1/chat-messages endpoint via HTTP to request information
  2. If your LLM and underlying infrastructure cannot answer fast ( < 30 sec) the conenction gives Nginx 504 Time out message and the related automation workflows end in Error

I searched for simillar issues, tried modifying nginx conf files - did not make sense. Please fix this or give a way to increase the time out value.

Image

✔️ Expected Behavior

Having a way to increase time out to a custom value.

❌ Actual Behavior

Failure after 30 seconds of Dify app returning result via API.

ndrewpj avatar Oct 10 '25 13:10 ndrewpj

Bump up the issue. Very announing one.

ndrewpj avatar Oct 23 '25 07:10 ndrewpj

Bump - please add vaariables to control the timeout values of nginx... very annoying issue

Image

Here are the Dify nginx node logs:

Image

ndrewpj avatar Nov 11 '25 08:11 ndrewpj

Hi, @ndrewpj. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that requests to the v1/chat-messages endpoint on self-hosted Dify v1.9.1 are timing out after 30 seconds with an Nginx 504 Gateway Timeout error.
  • Attempts to adjust Nginx timeout settings have not resolved the issue.
  • You requested the addition of configurable timeout variables to better manage Nginx timeouts.
  • Relevant logs were provided to illustrate the problem.
  • The issue remains unresolved.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here.
  • If I do not hear back within 15 days, I will automatically close this issue.

Thank you for your understanding and contribution!

dosubot[bot] avatar Dec 12 '25 16:12 dosubot[bot]