title: Nginx 502 bad gateway + PHP 7.2 FPM
body: <p>I've been trying to figure out this issue I have with Nginx getting a 502 bad gateway.</p>
  
  <p>The toughest part is the logs are pretty much useless for this.</p>
  
  <p>I am using VueJS, so the request/response is more of a REST architecture.</p>
  
  <p><a href="https://i.stack.imgur.com/mDcFy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mDcFy.png" alt="Here is an example of the"></a> </p>
  
  <p>What it currently is doing is simply trying to return company information, but I get a gateway error. The problem is, this is completely random.</p>
  
  <p>(Note: The CORS error is occurring because of the 502 Bad Gateway)</p>
  
  <p>It will happen only sometimes, but not all the time. When I put the request through a chrome extension called Restlet Client works perfectly fine.</p>
  
  <p><a href="https://i.stack.imgur.com/CGbHj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CGbHj.png" alt="enter image description here"></a></p>
  
  <p>Reviewing Nginx Errors, it is the Peer Reset Connection:</p>
  
  <p>2019/01/13 14:40:07 [error] 5467#5467: *537 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.252.1, server: _, request: "GET /v1/company/index/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "whitty.vm:130", referrer: "<a href="http://whitty.vm:8080/company" rel="nofollow noreferrer">http://whitty.vm:8080/company</a>"</p>
  
  <p>The PHP FPM Error that appears is:</p>
  
  <p>[13-Jan-2019 14:40:07] WARNING: [pool www] child 6063 exited on signal 11 (SIGSEGV) after 9328.151921 seconds from start
  [13-Jan-2019 14:40:07] NOTICE: [pool www] child 6410 started</p>
  
  <p>Does anyone have any clues as to why this may be occurring, do you require anymore information?</p>