Hi all. I'm trying to configure a proxy_loadbalancer with sticky session. I 
read 
around the web and in the source code and discovered that this module expects 
to 
handle sticky session by re-using the user's session ID provided by the origin 
server. This is different to BigIP which injects its own cookie that it keeps 
track of. Apache also expects the origin server to know it is being 
load-balanced and to change the session ID it creates to include a "route" that 
identifies that origin server.

So for example if my origin server is Tomcat then the session cookie would be 
JSESSIONID=12345... and Tomcat has to be modified to make it 
JSESSIONID="12345.route1". Apache mod_proxy_loadbalancer sees this and finds 
the 
route1 and chooses the right origin server based on that. I also read that PHP 
doesn't have the possibility of changing the cookie, but since PHP runs 
typically on Apache, it is possible to modify the configuration of the origin 
server to post-process the request to add it.

My problem is that I load balance a custom web server and/or IIS and we have 
neither of these options available. I need the cookie to go through as 
originally created and I can't change the way it gets created. So, how to do it?

I have tried to add a cookie at the proxy server, but I can't get this to only 
happen when the origin server sends through its cookie. In fact if the origin 
server sends an error code, the environment variable I use with SetEnvIf isn't 
set correctly. I can't see how to add a cookie in a post-processing filter of 
some sort either. The only ways I see to add cookies are in mod_rewrite (which 
seems strange to me) and via mod_headers.

Any ideas?

Thanks,

Michael


      

Reply via email to