title: Nginx/PHP-CGI - 502 Bad Gateway
body: <p>I appear to be having an issue with my website when I browse around (just clicking links here and there), and my system would return a random 502 Bad Gateway error. I can hit the refresh button and it would appear to work fine.</p>
  
  <p>Error Message:</p>
  
  <pre><code>2012/08/16 11:17:54 [error] 26777#0: *1049 recv() failed 
      (104: Connection reset by peer) while reading response header from upstream, 
      client: 66.162.194.10, server: SITE, 
      request: "GET /wp-admin/admin-ajax.php?action=dashboard-widgets&amp;widget=dashboard_secondary HTTP/1.1", 
      upstream: "fastcgi://unix:/tmp/php.socket:", host: "SITE", referrer: "SITE/wp-admin/index.php"
  
  2012/08/16 11:17:54 [error] 26777#0: *1049 connect() failed 
      (111: Connection refused) while connecting to upstream, 
      client: 66.162.194.10, server: SITE, 
      request: "GET /wp-admin/admin-ajax.php?action=dashboard-widgets&amp;widget=dashboard_secondary HTTP/1.1", 
      upstream: "http://127.0.0.1:9000/wp-admin/admin-ajax.php?action=dashboard-widgets&amp;widget=dashboard_secondary", 
      host: "SITE", referrer: "http://SITE/wp-admin/index.php"
  
  /etc/nginx/nginx.conf:
  user www-data;
  worker_processes 8;
  </code></pre>