How to transfer my domain to my rails application?

I am trying to transfer my domain. I am running my rails app using this command from my rails folder RAILS_ENV=production rails s --binding= However, I can only access it through but not

I might be wrong but I think I need to somehow serve my app from the root domain address like not I have already point my domain name to DigitalOcean by following this tutorial And I have also setup the host name with DigitalOcean. So right now I just need to configure rails, nginx, and unicorn somehow to serve my app at the domain address or (I don’t even know if that is what I need to do. so please help me!)

I am running Ubuntu 14.04 with rails, nginx, and unicorn. I’ve configured my nginx and unicorn according to this tutorial here

How do I make rails application accessible from the root of the domain address ( or is that eve necessary at all?

How exactly do I deploy my rails application? I am lost! Please help!

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You need to use nginx to proxy HTTP requests to whatever port unicorn is running on. In this specific case that is port 3000.

When you go to any website using a web browser by default is actually just sending a request to the IP address at on port 80. Likewise, when you go to it is sending a request to that IP address at on port 443.

So, in your case you have unicorn running on port 3000, and you need to get nginx to listen on port 80 and proxy all requests to port 3000.

  1. SSH into your server

  2. Edit the nginx config file nano /etc/nginx/sites-available/default

  3. Replace everything in there with this:

    server {
    listen 80;
    location / {
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  4. Restart nginx service nginx restart

You should now be able to access your rails app at both and assuming you have an A record for YOUR_WEBSITE.COM pointed to then you should also be able to access the app at http://YOUR_WEBSITE.COM

Hope this helps!