httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cameron Beattie" <kj...@orcon.net.nz>
Subject Re: [users@httpd] RewriteRule question: forward requests from one Apache server to another
Date Fri, 08 Jul 2005 02:58:45 GMT
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" <krist.vanbesien@gmail.com>
To: <users@httpd.apache.org>; "Cameron Beattie" <ext_news@appsfarm.com>
Sent: Monday, July 04, 2005 10:33 PM
Subject: Re: [users@httpd] RewriteRule question: forward requests from one 
Apache server to another


On 6/29/05, Cameron Beattie <kjcsb@orcon.net.nz> 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

-- 
krist.vanbesien@gmail.com
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message