You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Yu, Ming" <Mi...@jhuapl.edu> on 2004/06/08 19:46:28 UTC

[users@httpd] ProxyPreserveHost and ProxyPass

I am using Apache 2.0.49 as a reverse proxy server.  Recently I enabled
ProxyPreserveHost directory and ran into this interesting problem.
ProxyPass and ProxyPassReverse no longer works the same way.  It works fine
with those URLs of the proxied site as http://proxied.abc.com/somedir/
<http://proxied.abc.com/somedir/> .  But it does not work with the URLs of
the proxied site as http://proxied.abc.com/ <http://proxied.abc.com/> 

E.g.

The following is my virtual host configuration:

<VirtualHost 10.10.12.12:80>
ServerName Proxytest.abc.com
RewriteEngine On
ProxyPreserveHost On
ProxyRequests On
.
.
ProxyPass        /test1/      http://proxied.abc.com/essence/
<http://proxied.abc.com/essence/> 
ProxyPassReverse /test1/      http://proxied.abc.com/essence/
<http://proxied.abc.com/essence/> 

ProxyPass 	/test2/	http://test.abc.com/ <http://test.abc.com/> 
ProxyPassReverse /test2/ http://test.abc.com/ <http://test.abc.com/> 
.
.
.
</VirtualHost>

Before the ProxyPreserveHost is set to On, everything works fine.  But when
ProxyPreserveHost has been turned on, only test1 works fine, test2 stop
working.

Thank you in advance for any suggestions.

___________________________
Ming Yu
Applied Physics Laboratory
Johns Hopkins University
Laurel, MD 20723


Re: [users@httpd] ProxyPreserveHost and ProxyPass

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 8 Jun 2004, Yu, Ming wrote:
> ProxyRequests On

Why is ProxyRequests On?  This is probably a major security problem, 
unless you have proper forward-proxy restrictions in place someplace. 
Check the mod_proxy docs.

> .
> .
> ProxyPass        /test1/      http://proxied.abc.com/essence/
> ProxyPassReverse /test1/      http://proxied.abc.com/essence/
>
> ProxyPass 	/test2/	http://test.abc.com/ 
> ProxyPassReverse /test2/ http://test.abc.com/

> Before the ProxyPreserveHost is set to On, everything works fine.  But when
> ProxyPreserveHost has been turned on, only test1 works fine, test2 stop
> working.

Please define "stop working".  Exactly what do you see?

Is it possible that test.abc.com is sending redirects using the Host: 
header that it is receiving from your server?  Then obviously it would not 
match test.abc.com.  If that is the case, you probably want
ProxyPassReverse /test2/ http://thisserver.example.com/

Joshua.

---------------------------------------------------------------------
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