Trying to set up a simple nginx ruby on rails development. How do I run the app? Trying to set up a simple nginx ruby on rails development. How do I run the app? nginx nginx

Trying to set up a simple nginx ruby on rails development. How do I run the app?


For development you can use the built-in web-server with rails s in your project folder. It will runs your RoR app on 0.0.0.0:3000. Port can be changed with -p (rails s -p 80).


Read this guide to running rails on nginx using passenger:

Once Ruby on Rails is installed, go ahead and install passenger.

gem install passenger 

...

Set the root to the public directory of your new rails project. Your config should then look something like this:

server { listen 80; server_name example.com; passenger_enabled on; root /var/www/my_awesome_rails_app/public; }

(Don't forget the /public after the rails root location!)