1

I've been reading and learning a lot from you, guys, but this is the first time I post a question here. This is the situation: - I've got several web servers (CentOS 7 + Apache), some of them vitualized with KVM and one physical, running in a local network. - This network connects to the Internet with a dynamic IP. - At the moment, I add a port redirection to the router in order to access the different web servers. E.g. if I need to access my web server at 192.168.0.33 I use mydomain.dyndns.org:8033, the router maps the external port 8033 with the internal port 80 of the 192.168.0.33 machine.

This is what I need: - I want to have a kind of intermediate service (bind9? proxy? vhosts? anything!) to act like a virtual host of apache to route domains to internal IPs. E.g. When I want to get to the web app at 192.168.0.33 I use just domain33.dyndns.org. - If is it possible, I'd like to be able to make subdomains too. E.g Use webapp1.domain.dyndns.org to get to a specific apache directory.

Sorry if it's a silly question and thank you in advance.

Regards,

Damon H.

Damon Hill
  • 77
  • 2
  • 13

1 Answers1

0

What you're looking for is a reverse proxy. You can probably do this with one of your existing web servers, since apache and nginx both support reverse proxying.

What you need to do is setup one of your servers as a reverse proxy, then port forward 80/443 to that server only. Setup dynamic dns hostnames for your different internal servers, all pointing to your WAN IP. When your reverse proxy receives an http connection, it will then proxy it to the appropriate internal server depending on the requests HTTP host header.

reverse proxy

IsAGuest
  • 947
  • 9
  • 14
  • Hey, thanks for your help. I'll try to setup a reverse proxy with apache. One more question: what if I want to use subdomains, e.g. server1.mydomain.com for one internal ip and server2.mydomain.com for another internal ip? – Damon Hill Oct 14 '16 at 13:00
  • You can have unique reverse proxy settings for each domain, like in [this post](http://stackoverflow.com/a/13241047). – IsAGuest Oct 14 '16 at 13:17