Keep getting 502 Bad Gateway


I have set up a drupal site using nginx. But after a few weeks it will
get 502 bad gateway error on the site. I’m still at the testing stage
and my site doesn’t receive any traffic but keeps going down. After I
reboot the server it became alright but after a few days the error will
come back. Any ideas what is wrong?

Error log file:
[error] 7563#0: *6 connect() failed (111: Connection refused) while
connecting to upstream, client: ip, server:, request: “GET /
HTTP/1.1”, upstream: “fastcgi://”, host: “

Posted at Nginx Forum:

I persume you are using php-fpm, try using the static process manager