Question
502 Bad Gateway Randomly Ocurring
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.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×