php 为什么在 ajax 请求期间从上游读取响应标头时出现错误:recv() failed (104: Connection reset by peer)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40426947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:10:11  来源:igfitidea点击:

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

phpajaxnginxserverfastcgi

提问by Dominik

I had problem with ajax. It always stopped working 5 min after request. I did't know what was causing it. I looked on many pages to find a sollution but nor provide good one. What I can do ?

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

回答by Dominik

You need to check what you have set in /etc/php5/fpm/pool.d/www.conf file in line request_terminate_timeout. I has got:

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

request_terminate_timeout = 300s

request_terminate_timeout = 300s

This is because it had always stopped working after 5 min (300s = 5min)

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

After i changed it to request_terminate_timeout = 3600smy problem have gone. I have got now 60 min to complete my ajax request :)

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

PS Make sure that you remove ;before that line because it is used to comment line.

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