By siwsonu
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?
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!
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;
server_name example.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:50000;
}
}
Then restart nginx:
service nginx restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.