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. 100.201.202.203:50000). I add a domain and its the same, only work with the port (e.g www.something.com:50000). Someone know why is this happening and how can I fix it?
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
Then once it’s installed, edit the nginx configuration file in
/etc/nginx/sites-enabled/
so it reads like:Then restart nginx: