Hi,
We have the following setup:
'Net <----> Load balancer <-----> Apache 2.2.2 <-------> Apache 1.3.34
*Note: Apache 2.2.2 and 1.3.34 are on the same server, listening on
different ports.
Apache 2.2.2 is the front end web server that receives the clients
requests. It handles all requests except for URLs asking for files with
a particular extension. These files are processed by a module that only
works with Apache 1.3.x. For those "special" files, Apache 2.2.2
performs a rewrite(mod_rewite) that hands off the processing to Apache
1.3.34. To get this to work, I had to use the ProxyPreserveHost On
option so Apache 1.3.34 would know what host to use. Works great
except for one domain. This "special" domain also has forums that are
running on a set of internal web servers.
So now I need to get a "normal" reverse proxy working,
ProxyPass/ProxyPassReverse. The problem is, this won't work with
ProxyPreserveHost On.
Here is the config (shared by Apache 2.2.2 and Apache 1.3.34):
<VirtualHost 192.168.107.37>
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /data/domain.com
<IfDefine REVERSE_PROXY>
ProxyPreserveHost On
RewriteEngine on
RewriteCond %{LA-U:SCRIPT_FILENAME} \.ext$ [NC]
RewriteRule .* http://192.168.107.37:8080%{REQUEST_URI} [P,L]
ProxyPassReverse / http://192.168.107.37:8080/
</IfDefine>
# Push through to forum server (proxy)
RewriteEngine On
RewriteRule /info/forum/(.*) /community/forum/ [R,L]
<IfModule mod_proxy.c>
ProxyPass /community/forum/ http://forums.domain.com/
ProxyPassReverse /community/forum/ http://forums.domain.com/
</IfModule>
</VirtualHost>
With this configuration:
- When I hit Apache 2.2.2 for anything but files with the 'ext'
extension, it handles it with no problems.
- When I hit Apache 2.2.2 for any file ending with .ext, it get
rewritten and passed to apache 1.3.34.
Problem:
- When I hit Apache 2.2.2 with a request for /community/forum/ I just
get redirected to the sites home page, I don't get the forums as
expected. ProxyPresearveHost is doing it's job of preserving the host,
but in this case I don't want it to. I tried putting ProxyPreserveHost
Off before the first ProxyPass entry, same result. I tried putting it
at the bottom of the <IfDefine REVERSE_PROXY>, same problem. Can
PresearveProxyhost not be turned on then off again?
Notes:
1) Apache 2.2.2 and Apache 1.3.34 are using the same Vhost config file,
defines are used to control "who sees what".
2) Apache 2.2.2 is started with -DREVERSE_PROXY so it will process the
REVERSE_PROXY block, while apache 1.3.34 is not passed any parameters,
so it ignores the REVERSE_PROXY block.
Another question, have I over complicated the situation and there is a
better solution?
Thanks,
David f.
---------------------------------------------------------------------
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]