【发布时间】:2020-07-15 09:21:47
【问题描述】:
我有一个由 nginx 代理的 nextjs 项目。我正在使用由 nextjs 本身提供的 rest api,需要超过 2 分钟。
我得到的第一个错误是 nginx 的 504 超时,所以我添加了一些额外的指令:
proxy_connect_timeout 600s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
然后错误代码变成502。查看proxy_error_log文件错误是
upstream prematurely closed connection while reading response header from upstream.
在我的项目中,我没有明确使用 express 或任何其他服务器,所以我不知道如何设置 http 服务器超时。有什么方法可以从 next.config.js 文件或全局节点 js 设置超时?
【问题讨论】:
-
可能有任何更新吗?如果您找到了解决方案,请您回答您自己的问题,我支持它。
标签: next.js