Nginx is a reverse proxy server - its role on your server is to accept HTTP requests and pass them to another process on the same host. The "upstream" referred to in the error message refers to a bit in the nginx configuration (of which the /etc/nginx/sites-available/default file is part), which tells it where to send incoming requests. The error message you see indicates that nginx received the request, but was unable to send it to another process that it should have used.
When your server rebooted, the nginx process started, but your Rails process β the one intended for listening on port 3001 β did not!
How to restart the Rails process depends on how you started it before and how your server is configured. It can be as simple as cd entering your Rails application directory on the server and running:
rails server -b 127.0.0.1 -p 3001 -e production -d
... but to prevent similar situations in the future (and to improve the performance of your Rails application!) it would be better to use some kind of Rails application server ready for production. I would recommend using Phusion Passenger , because this is the most suitable solution - they are described for installation and configuration for nginx , but there are many alternatives. There's an excellent record of what your options are, what they all mean, and how they relate to fooobar.com/questions/13951 / ....
source share