By tokenizator
Hello,
How does one forward IP:PORT to registered domain name? so instead of the IP:PORT appearing in the address bar, the registered domain name appears instead.
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!
Hey friend!
This is a great question, and a fairly common concern. The first key is to move out of the mindset of forwarding it via DNS, which is what almost everyone thinks of first in the process. DNS is merely a name translated to IP, so 1.1.1.1:3000 after DNS = mydomain.com:3000, as DNS cannot mask a port.
(I’m using 1.1.1.1 as a sample IP address for this post)
The second key is to recognize how ports are masked by web browsers:
Web browsers mask ports 443 and 80 via https or http, as that value instructs the browser to connect on one of those two ports. So what you need to do is have your application served via port 443 (with SSL certificate) or port 80 (no SSL). One way to do this is to change your application configuration to make it listen on one of those ports. Another way is to use a reverse proxy. A reverse proxy takes in requests on port 80 or 443, pulls data from the other port, and serves it to the visitor over the common ports.
Here’s a tutorial for using Apache as a reverse proxy: https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04
Jarland
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.