Why I need include port with the domain/ip ?

Hi, I just create a droplet using dokku and deploy a RoR app, the problem is that only with the ip addres the web app doesn’t open, the browser show this message “This webpage is not available”, only if I specify the port it work (e.g. I add a domain and its the same, only work with the port (e.g Someone know why is this happening and how can I fix it?

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.

When you use a URL without a port included your browser assumes it is port 80 (or 443 for HTTPS). Using anything else requires it to be specified. Generally with modern apps using Rails, a JavaScript framework or something other than static HTML or PHP scripts you will use a reverse proxy web server in front of the app to process requests (this also automatically gives you nice standard access logs). What you can do is:

First install nginx

sudo apt-get update;
sudo apt-get install nginx;

Then once it’s installed, edit the nginx configuration file in /etc/nginx/sites-enabled/ so it reads like:

server {
        listen   80; 
     location / {      
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;


Then restart nginx:

service nginx restart