I have a rails app that I just deployed to Digital Ocean and it works on Puma and Nginx.
In the end, everything it returns is a bad gateway, and that is what is in the error.log file
2014/09/09 22:23:06 [error] 5729#0: *3059 connect() to unix:///var/www/mysite/mysite_app.sock failed (111: Connection refused) while connecting to upstream, client: 67.5.19.192, server: mysite.com, request: "GET / HTTP/1.1", upstream: "http://unix:///var/www/mysite/mysite_app.sock:/", host: "mysite.com"
To fix this, I just restart puma and it seems to work.
How can I debug this to find out why he continues to die?
Here is my nginx configuration:
upstream mysite { server unix:///var/www/mysite/mysite_app.sock; } server { listen 80; server_name mysite.com; root /var/www/mysite/current/public; client_max_body_size 20M; location / { proxy_pass http://mysite;
EDIT
Could this be caused by a lack of memory?
Here is my current state of memory, but since I constantly execute this command every time, the amount of free memory is reduced, and as soon as I restart puma, it jumps back to 150.
$ free -m total used free shared buffers cached Mem: 490 440 50 0 17 84 -/+ buffers/cache: 338 151 Swap: 0 0 0
source share