You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "charlycr74@yahoo.com.ar" <ch...@yahoo.com.ar> on 2007/12/04 21:47:42 UTC

[users@httpd] ProxyPass with http 302 redirect

Hi,

I'm trying to setup ProxyPass with mod_proxy_balancer and something weird is happening. 

It seems when the backend server responses with an http 302 redirect, it tries to redirect me to the backend URL instead of the apache URL.

For example, When I do a post to http://www.domain.com/login.do I'm getting an HTTP 302 Redirect to http://10.1.1.2:8080/login2.do instead of http://www.domain.com/login2.do.

My backend servers are running tomcat and I don't have any virtualhost on the apache neither on the tomcats.

This is my configuration:

ProxyPass /balancer-manager !

ProxyPass / balancer://appcluster/
ProxyPassReverse / balancer://appcluster/

<Proxy balancer://appcluster>
   BalancerMember http://10.1.1.2:8080/
   BalancerMember http://10.1.1.3:8080/
</Proxy>


Thanks,

Carlos




      Tarjeta de crédito Yahoo! de Banco Supervielle.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar 

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


Re: [users@httpd] ProxyPass with http 302 redirect

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Tue, Dec 04, 2007 at 12:47:42PM -0800, charlycr74@yahoo.com.ar wrote:
> Hi,
> 
> I'm trying to setup ProxyPass with mod_proxy_balancer and something weird is happening. 
> 
> It seems when the backend server responses with an http 302 redirect, it tries to redirect me to the backend URL instead of the apache URL.
> 
> For example, When I do a post to http://www.domain.com/login.do I'm getting an HTTP 302 Redirect to http://10.1.1.2:8080/login2.do instead of http://www.domain.com/login2.do.
> 
> My backend servers are running tomcat and I don't have any virtualhost on the apache neither on the tomcats.
> 
> This is my configuration:
> 
> ProxyPass /balancer-manager !
> 
> ProxyPass / balancer://appcluster/
> ProxyPassReverse / balancer://appcluster/
> 
> <Proxy balancer://appcluster>
>    BalancerMember http://10.1.1.2:8080/
>    BalancerMember http://10.1.1.3:8080/
> </Proxy>
> 


ProxyPassReverse is not (yet) balancer aware, so mod_proxy is
looking for a Location header that has 'balancer://appcluster/'
in there and, of course, it doesn't exist. You need to replace
your ProxyPassReverse line with

   ProxyPassReverse / http://10.1.1.2:8080/
   ProxyPassReverse / http://10.1.1.3:8080/

 
-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
        "Great is the guilt of an unnecessary war"  ~ John Adams

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