Nginx stops serving passenger app (503)

elasticsearchnginxphusion-passengerserver-crashes

I'm deploying a rails app through passenger and nginx (utilizing an elastic-search server which is running on the same machine) on a Ubuntu system. This works perfectly for about twelve hours. Then, the servers only response is a 503 message. Restarting nginx fixes the problem.

I already looked plenty at the logs of rails/nginx/elasticsearch, but couldn't find any clues on this "crash". Only some generic routing errors are visible.

Is there any other place I could check? How can I effectively debug this behaviour?

Best Answer

503 means service not available, usually maintenance or server can't respond because overloaded.

Assuming all packages related to the deployment are updated, and no external (d)DoS attacks are attempted, does the app/elasticsearch establish many connections outside? Try to have a look to netstat.