RE: Issue with mod_proxy when using Proxy balancer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI

 

Ya this problem comes when we use mod_proxy_http instead we should use mod_proxy_ajp module.

 

How to :

 

This is your previous configuration

 

<Proxy balancer://ebsCluster>
        BalancerMember  http://10.25.9.192:10010 route=route1
        BalancerMember  http://10.25.9.193:10010 route=route2
 ProxySet stickysession=APACHEBALANCE
</Proxy>

 

ProxyPass               / balancer://ebsCluster/
ProxyPassReverse        /threestore balancer://ebsCluster/

 

Just replace it by

 

Note here we are using ajp protocol for sending request from apache to weblogic. So enable ajp protocol connector in you weblogic backend.

Then use following configuration :- (make sure mod_proxy_ajp must be loaded  in apache)

 

<Proxy balancer://ebsCluster>
        BalancerMember  ajp://10.25.9.192:<ajp_port> route=route1
        BalancerMember  ajp://10.25.9.193:<ajp_port> route=route2
 ProxySet stickysession=APACHEBALANCE
</Proxy>

 

ProxyPass               / balancer://ebsCluster/
ProxyPassReverse        /threestore balancer://ebsCluster/

 

If you use ajp protocol instead of http for connecting  apache to web logic it would be less expensive. Because whatever header sent by ajp are shorter then http.

But still you want to you http then please let me know other wise this is better option.

Ok bye

Thanks

Narendra

 

 

-----Original Message-----
From: Justin Maguire [mailto:ejusmag@xxxxxxxxx]
Sent: Friday, March 14, 2008 3:25 PM
To: users@xxxxxxxxxxxxxxxx
Subject: Issue with mod_proxy when using Proxy balancer

 

Hello,

 

I am facing an issue when using mod_proxy to load balance to my backend servers. Issue arises when the backend Weblogic server sends a a redirect response back, which results in the backend server ip being passed on page location.

I will explain further with an example.

 

Apache 2.2 Server: example.com

Backend Server: http://10.25.9.192:10010

 

I request http://example.com/ which is proxied to http://10.25.9.192:10010/

weblogic.com then access index.jsp which sends a redirect to

 

My index.jsp contains the following

"<% response.sendRedirect("page1.xhtml"); %>"

 

Now my browser is redirected to http://10.25.9.192:10010/page1.xhtml instead of being redirected with the apache proxy http://example.com/page1.xhtml

 

Header add Set-Cookie "APACHEBALANCE=balancer.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED

 

<Proxy balancer://ebsCluster>
        BalancerMember  http://10.25.9.192:10010 route=route1
        BalancerMember  http://10.25.9.193:10010 route=route2
 ProxySet stickysession=APACHEBALANCE
</Proxy>

 

ProxyPass               / balancer://ebsCluster/
ProxyPassReverse        /threestore balancer://ebsCluster/

 

If I use ProxyPass without the balancer I do not get the same problem

ProxyPass               / http://10.25.9.192:10010/
ProxyPassReverse        / http://10.25.9.192:10010/

With the above the browser is redirect to  http://example.com/page1.xhtml

 

Any ideas or ways I could work around this?

 

Thanks!

Justin

 


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux