Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have three separate web servers with three different internal IP addresses on a network with only one public IP address. Each web server has security restrictions such that I cannot just run all of my websites on a single web server. All are running Apache.

I want to setup subdomains that allow me to access each of the different web servers remotely, all on port 80. E.g.,

Where all three of those domains resolve to my single public IP address, but some type of service examines the request to see which subdomain is being requested and pulls the data from the appropriate server.

Is this type of thing (1) possible and (2) easy to implement? I'm running Ubuntu Server 9.04.

share|improve this question
up vote 5 down vote accepted

This is called Reverse Proxy, you can redirect all trafic on port 80 to one Apache server, configure 3 vhost (1 per subdomain) and in the 2 vhost handling non local website use the Apache ProxyPass directive to tell apache to load content from another server.

nginx can also act as a reverse proxy. You can forward all request to nginx then nginx will load content on one the right server depending of the subdomain.

I would use the Apache proxypass feature, it's easier to setup from my point of view.
You can also start a 4th apache server that will only act as reverse proxy. In this case all of the 3 vhost will use proxypass to get content from the right server.

See for an example, you case is the same execpt that you have a third subdomain (so you need 1 more vhost).

share|improve this answer
This is great! Thank you so much. – Kirk Ouimet Aug 18 '09 at 23:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.