I have a rails app that uses Nginx and Puma. Every 2-4 weeks my app starts giving 502 errors. When digging into log files, this is the error that comes up
[error] 8353#8353: *38966 connect() to unix:///home/deploy/ap...
What is your Droplet size? It could be that app gets killed due to it ran out of memory.
Syslog could give you more information on that. Open it with your favorite text editor:
sudo nano /var/log/syslog