1

I have a setup of nginx1.20.1 + php7.3.3 on Centos7. We run those VMs beneath google cloud load balancer. Sometimes, randomly there is 502 returned to the end client. I traced one of those error sources to the Nginx error log saying "upstream prematurely closed FastCGI stdout while reading response header from upstream".

What would be the easiest way to debug what is causing these random events?

Recently I modified www.conf file and increased pm.max_children values to higher as I had warning of them being reached to the maximum. I hoped that it would be the cause of those errors, but it did not solve the problem.

I should somehow trace that event on production, but how?

Tim
  • 31
  • 3
  • I found documents that keepalive_requests should be the same as pm.max_requests on www.conf to prevent errors like the above from happening. Can someone confirm this setting is true? – Tim Aug 19 '22 at 12:04

0 Answers0