0

I have a multiple server setup that I am having difficulty figuring out the best way to solve a problem.

I have several domain names that are accessed via a single IP address and served from one server (Apache Vhosts) All requests are port forwarded by the router for ports 80 and 443 to that server.

I recently moved one domain from the server to a new server with a different internal IP address (but sharing the same external IP) and I was wondering if it was possible for me to use Apache to pass the request for that domain name to the new server.

I am aware that I can use port forwarding on the router to forward a different port but I don't want my users to have to put in a port number to be able to access the second server. I really want the changes on the server side to be transparent to users.

Is there a way i can do this filtering by domain name requested ...

1 Answer 1

2

Configure a VirtualHost as all the others and configure the ProxyPass and ProxyPassReverse for this specific domain:

Servername www.somedomain.com
ProxyPass / http://internal-web-server/
ProxyPassReverse / http://internal-web-server/

See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html for details

1
  • 1
    Just as a side-note: this only works for protocols Apache does provide proxy modules for. So this can't be done with e.g. SSH.
    – Daniel
    Commented Jun 19, 2015 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .