How to mask redirect a subdomain to IP:Port

Posted May 10, 2017 9.7k views
ApacheUbuntu 16.04

I have a subdomain, lets say I want it to point to my.ip:3838. Is there a way to do this, so it still shows in the address bar?
Whenever I try it in the add records part of the droplet it says that I can’t redirect to an IP. I have Shiny Server and Rstudio installed on the IP and I would like the subdomains to be a clean place for me to navigate to them from.

I have wordpress installed on the domain and would like to keep that there. I’m also using other subdomains with a basic index.html file and that is working fine.


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.

Submit an Answer
2 answers

You can configure your webserver to proxy requests.


I’d take a look at the guide below here at DigitalOcean:

That should provide more insight as to how to go about setting up Apache to function as a proxy. More specifically, you want to look at Modifying The Default Configuration. You can skip the load balancing portion as it’s not relevant (unless you’re trying to load balance).

by O.S. Tezer
In this DigitalOcean article, we are going to see set up Apache on Ubuntu 13 and use it as a reverse-proxy to welcome incoming connections and redirect them to application server(s) running on the same network. For this purpose, we are going to use and work with the mod_proxy extension and several other related Apache modules.