I deployed my rails application on the server with capistrano, nginx and puma, following this tutorial- https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma.
App is running fine in localhost:3000. I can also run on-> rails server --binding=My_IP I can see my app in action on-> http://My_IP:3000
When I browse http://My_IP , I saw welcome to nginx screen. But according to document, when I run - sudo rm /etc/nginx/sites-enabled/default sudo ln -nfs “/home/username/apps/appname/current/config/nginx.conf” “/etc/nginx/sites-enabled/appname” (Ofcourse I changed username and appname)
I can NOT connect to my server’s IP address (says Unable to connect… can’t establish a connection).
Nginx server is running. I also tried running with systemctl start nginx command.
May be something wrong with Puma? I can NOT connect my Puma web server to the Nginx reverse proxy? I am not sure.
I searched online, some people have puma.rb file but I don’t have(document does not mention). I just have Puma gem in my Gemfile. Do I need config/puma.rb file?
I have- Rails -v 4.2.5 Ruby -v 2.3.0
So my problem is I can NOT run my application on my servers IP address. App is only running default on localhost:3000 Is it problem with port 80? Puma is not connected to port 80?
I need help running my application in production.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!