You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by gm...@ulmail.net on 2009/05/12 23:50:36 UTC

[users@httpd] mod_proxy_balancer and stickysession

Hi,

we want to use mod_proxy_balancer to load balance a J2EE
application server. So stickysession is set to JSESSIONID.
First I had:

	<Proxy balancer://default>
	  BalancerMember http://host1
	  BalancerMember http://host2
	  BalancerMember http://host3
	  ProxySet stickysession=JSESSIONID
	</Proxy>

	ProxyPreserveHost On
	ProxyPassMatch ^(.*\.jsp)$ balancer://default$1
	ProxyPassMatch ^(.*\.do)$ balancer://default$1

But the session was not sticky. After some TCP dump and reading
a bit more documentation, it seems that mod_proxy_balancer
alters the sessionid by appending ".[number]".

So now I have:

	<Proxy balancer://default>
	  BalancerMember http://host1 route=0
	  BalancerMember http://host2 route=1
	  BalancerMember http://host3 route=2
	  ProxySet stickysession=JSESSIONID
	</Proxy>

	ProxyPreserveHost On
	ProxyPassMatch ^(.*\.jsp)$ balancer://default$1
	ProxyPassMatch ^(.*\.do)$ balancer://default$1

In all likelihood this works better. Is this the right way to
do it?

Regards,
Gerhard

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