1

I have multiple web site hosts currently served by apache2's virtual hosts. I was wondering if it is possible to configure apache (or is some other tool more appropriate) to forward port 80 traffic destined for a particular host to a separate, actual server, that is the main server would serve most of the virtual hosts, but requests destined for www.myexample.com would be forwarded to a completely different server ?

Sorry if this question is common, but I do not even know what to search for to narrow down the list or responses that i am getting (most deal with setting up the virtual server, which I already have running).

Thanks Joe

Joe Simon
  • 99
  • 1
  • 2
  • 9

1 Answers1

0

I would use Nginx as a reverse proxy. There's some information on how to do that Here. Depending on the details of what you're trying to do, you might have a different configuration.

In addition to the tutorial above, here is some more information about Nginx and reverse proxies:

Reverse Proxy Module for Nginx
Reverse Proxy Wikipedia article

The way I would do it for your setup would be to make nginx the default httpd, by having it listen on port 80, then switch your Apache virtual configuration to 8080. Then just follow the links I've provided for a very vanilla style setup. Basically, you'll configure the new URL to forward to your other server in Nginx, then have all other URLs go to 8080, where it will hit your current Apache stack. If you were so inclined, you could move your Apache virtual servers down into the Nginx configs, but its not really necessary. Nginx reverse proxy on top of Apache is a fairly common configuration.

DavidJFelix
  • 728
  • 1
  • 6
  • 22
  • Great, that sounds like what I am looking for. I will check into Nginx – Joe Simon Jul 15 '13 at 19:41
  • If you found the answer helpful, you can vote for it and mark it as accepted using the arrow interface to the left of the post. Hope this helps you! – DavidJFelix Jul 16 '13 at 12:14
  • I installed Nginx and got it configured it appears to do wehat I want and it was fairly easy ()took maybe 2 hours to get the setup that I wanted. – Joe Simon Jul 25 '13 at 19:09