title: 502 bad gateway error
body: <p>When I browse the Magento web site multiple times, I usually get 502 bad gateway error at Nginx.<br>
  Please help me on fixing this issue.</p>
  
  <p>Note:- php5-fpm is not running some of the time. After restarting the php5-fpm, everything  is working fine but after some time I am getting the same<code>(php5-fpm is not running)</code> error again .</p>
  
  <p><img src="https://i.stack.imgur.com/R7BHs.jpg" alt="enter image description here"></p>
  
  <p>Ngnix Error Logs: -</p>
  
  <pre><code>2014/06/30 12:24:17 [error] 13359#0: *297122 connect() failed (111: Connection refused) while connecting to upstream, client: xxxxxxxx, server: www.xxxxxxxx.com, request: "GET /ultimate-comics-x-men-1967641 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxxxxxxx.com"
  2014/06/30 12:24:28 [error] 13359#0: *297124 connect() failed (111: Connection refused) while connecting to upstream, client: xxxxxxxx, server: www.xxxxxxxx.com, request: "GET /virtual-engineering-simulation-and-optimization HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxxxxxxx.com"
  </code></pre>