title: 502 bad gateway nginx + puma + rails 3.2 on Elastic Beanstalk
body: <p>The deployment was successful and everything is green. But when we try to access the application URL, it gives <code>502 Bad Gateway</code> error.</p>
  
  <p>Checking for puma process with <code>ps -aux | grep puma</code> doesn't return any process attached to puma server but <code>pgrep</code> returns following.</p>
  
  <pre><code>$pgrep -fl puma
  18009 su -s /bin/bash -c bundle exec puma -C /opt/elasticbeanstalk/support/conf/pumaconf.rb webapp
  18031 ruby /opt/rubies/ruby-2.0.0-p598/bin/puma -C /opt/elasticbeanstalk/support/conf/pumaconf.rb
  </code></pre>