Report this

What is the reason for this report?

502 Bad Gateway Randomly Ocurring

Posted on August 6, 2015
Sukh

By Sukh

Hi

I have a droplog setup on CentOS7 running the latest version of Nginx and PHP-FPM and a couple of modules like mbstrings, gd and common. I have also enabled OPCache and APCU.

Whilst browsing my website I am getting random 502 Bad Gateway on different pages. Refreshing the page 1-4 times loads the page. Restarting PHP-FPM allows me to browse about 7-8 pages before the issue happens afterwhich every 3-4 different pages later this error occurs on it.

I have looked at the nginx log

2015/08/06 10:13:10 [error] 10996#10996: *1042 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 90.216.134.197, server: www.s-heer.co.uk, request: “GET /discography/a/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.s-heer.co.uk”, referrer: “http://www.s-heer.co.uk/discography/” 2015/08/06 10:13:13 [error] 10996#10996: *1042 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 90.216.134.197, server: www.s-heer.co.uk, request: “GET /discography/a/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.s-heer.co.uk”, referrer: “http://www.s-heer.co.uk/discography/” 2015/08/06 10:23:59 [error] 10996#10996: *1061 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 90.216.134.197, server: www.s-heer.co.uk, request: “GET /discography/f/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.s-heer.co.uk”, referrer: “http://www.s-heer.co.uk/discography/e/

Not really sure how to proceed or what to do to fix this. The only difference between my DO drop and where my current site is hosted is DO drop I have added APCU. My other host where my site currently is does not have this issue. I cant migrate over to DO until this is resolved as it would result in to many 502 errors.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.