habbywall
By:
habbywall

How to mask redirect a subdomain to IP:Port

May 10, 2017 195 views
Apache Ubuntu 16.04

I have a subdomain, lets say example.mysite.com. I want it to point to my.ip:3838. Is there a way to do this, so it still shows example.mysite.com 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 mysite.com 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.

Thanks!

2 Answers

You can configure your webserver to proxy requests.

  • Not sure which file I'd put the proxy request in, or what would it look like in this case?

    • Google "<insert your webserver here> proxy" and follow the documentation.

@habbywall

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

https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

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.
Have another answer? Share your knowledge.