Thanks for the tip. I prefer that way. The final config is:
Server 1
NameVirtualHost *:80

<VirtualHost *:80>
       ServerName server.mydomain.com
       ProxyPreserveHost On
       RewriteEngine On
       RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P]
</VirtualHost>
<VirtualHost *:80>
       ServerName otherserver.mydomain.com
       ProxyPreserveHost On
       RewriteEngine On
       RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P]
</VirtualHost>

Server2
NameVirtualHost *:8008

<VirtualHost *:8008>
       ServerName server.mydomain.com
       DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:8008>
       ServerName otherserver.mydomain.com
       DocumentRoot /var/www/html2
</VirtualHost>

Hope this helps someone.

Cameron

----- Original Message ----- From: "Krist van Besien" <[EMAIL PROTECTED]>
To: <users@httpd.apache.org>; "Cameron Beattie" <[EMAIL PROTECTED]>
Sent: Monday, July 04, 2005 10:33 PM
Subject: Re: [EMAIL PROTECTED] RewriteRule question: forward requests from one Apache server to another


On 6/29/05, Cameron Beattie <[EMAIL PROTECTED]> wrote:
For those interested, I ended up using different ports to achieve the
desired result. There may be a better way but this works for me:

Good that it works now, but your original setup would have worked had you added:

ProxyPreserveHost On

to your config.

WIth this option the original "Host" header is preserved, and the
internal server can than select the correct virtual host based on it.

Krist

--
[EMAIL PROTECTED]
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to