Report this

What is the reason for this report?

Run rails app on IP instead of port.

Posted on March 3, 2017

Hello, I deployed my rails app on my droplet using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-git-hooks-on-ubuntu-14-04 -> with git hooks, puma and nginx.

But when my app is running I can only access it using http://my_ip_address:3000, when 3000 is app’s localhost port.

How to configure app in order to get it under http://my_ip_address?

Thank you in advance for your help.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

@todoardo

You’ll need to change server_name in your server block as what you have now will most likely cause NGINX to fail when attempting to start/restart/reload.

This:

server_name http://46.101.198.190/;

Should be (as per the tutorial):

server_name localhost;

Other such valid configuration would be:

server_name domain.com www.domain.com;

or

server_name domain.com *.domain.com;

or

server_name hostname.domain.com www.hostname.domain.com;

ect.

After changes have been made and saved, you’ll need to reload NGINX using:

systemctl reload nginx

or

service nginx reload

Read the “Install and Configure Nginx” part of the tutorial you linked.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.