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 am running a web server and now I want to be able to use another device that also requires port 80, but I only have a single IP. My web server is Ubuntu and uses Apache. Is there a trick to reroute requests to a certain internal IP based on a domain name? How would I do that?

share|improve this question
Are you wanting to run two web servers or run two websites on the same web server? – Jake Wilson Nov 10 '11 at 17:59
Two "servers". I have one of those NAS devices that require port 80 to be forwarded to it. I am already running multiple web sites. – Mike Wills Nov 10 '11 at 18:02

You'll need to use mod_proxy as a reverse proxy for this.

share|improve this answer
  • create apache namevirtualhosts and forward one virtualhost traffic to the internal IP address with mod_proxy (ProxyPass or RewriteRule [P] )


  • use iptables DNAT to forward all requests coming to port 81 towards internal IP port 80.
share|improve this answer

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.