# Keep getting 502 Bad Gateway

**URL:** <https://www.ruby-forum.com/t/keep-getting-502-bad-gateway/195848>\
**Category:** NGINX\
**Created:** [October 1, 2010, 5:36am UTC](https://www.ruby-forum.com/t/keep-getting-502-bad-gateway/195848 "2010-10-01T05:36:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![illusime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/5f8ce5/32.png) [@illusime](https://www.ruby-forum.com/u/illusime)\
**Post date:** [October 1, 2010, 5:36am UTC](https://www.ruby-forum.com/t/keep-getting-502-bad-gateway/195848/1 "2010-10-01T05:36:16Z")

</div>

Hi,

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: [mysite.com](http://mysite.com), request: “GET /  
HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “[mysite.com](http://mysite.com)”

Posted at Nginx Forum:

> **[Keep getting 502 Bad Gateway](https://forum.nginx.org/read.php?2,135848,135848#msg-135848)**
>
> Hi, 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...

---

<div class="post-metadata">

**Author:** ![illusime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/5f8ce5/32.png) [@illusime](https://www.ruby-forum.com/u/illusime)\
**Post date:** [October 1, 2010, 7:55am UTC](https://www.ruby-forum.com/t/keep-getting-502-bad-gateway/195848/2 "2010-10-01T07:55:31Z")

</div>

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