Why am i getting error: recv() failed (104: Connection reset by peer) while reading response header from upstream during ajax request

Why am i getting error: recv() failed (104: Connection reset by peer) while reading response header from upstream during ajax request

我遇到了 ajax 的问题。它总是在请求后 5 分钟停止工作。我不知道是什么原因造成的。我查看了很多页面以找到解决方案,但也没有提供好的解决方案。我能做什么?

您需要检查您在 /etc/php5/fpm/pool.d/www.conf 文件第 request_terminate_timeout 行中的设置。我有:

request_terminate_timeout = 300s

这是因为它总是在 5 分钟后停止工作(300 秒 = 5 分钟)

在我将其更改为 request_terminate_timeout = 3600s 之后,我的问题就解决了。我现在有 60 分钟的时间来完成我的 ajax 请求 :)

PS 确保删除该行之前的 ;,因为它用于注释行。