Link to home
Start Free TrialLog in
Avatar of Michael Worsham
Michael WorshamFlag for United States of America

asked on

Redirect to secondary private network server

Okay, here's the situation. I have a publicly accessible static IP address that currently has port 80 forwarded from the firewall/router to an internal private web server (i.e. 192.168.0.3) that is handling several websites via Virtual Hosts. This works like a charm without any issues.

I am in the progress on building a 2nd internal web server (i.e. 192.168.0.12) that will house only one 'testing' web instance. Since port 80 is already forwarded on the firewall to the primary web server, I would like to keep the virtual host on the primary web server, but redirect (proxy) all inbound http connectivity for this other domain name to the 2nd internal web server after seeing the entry on the primary web server.

Internet --> Firewall/Port Forward (Forward Port 80) --> Primary Web Server (Listen Port 80) --> mod_proxy --> 2nd Internal Web Server (Listen Port 80)

What do I need to do on the primary web server's Virtual Host entry to redirect all traffic to the 2nd web server while maintaining the domain name in the URL (i.e. not showing the user the site is being redirected)?

I thought of something like this, but I don't know if that would really work or not...

<VirtualHost *:80>
  ServerName myothersite.com
  ServerAlias www.myothersite.com
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass / http://192.168.0.12/
  ProxyPassReverse / http://192.168.0.12/
</VirtualHost>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kerem ERSOY
Kerem ERSOY

I'm using a similar setup and it works like charm : ) I'm sure it will work for you too.
Avatar of Michael Worsham

ASKER

Yep. Worked like a charm. Thanks!
Yr welcome :)