Willy,

Before trying the workaround, I did use mod_write on Apache in front of HAproxy 
to change "/app;jsessionid=..." into "/app;JSESSIONID=..."  HAproxy log showed 
the modified request correctly matched expectations, such that the incoming 
URL-based cookie name was uppercase JSESSIONID, the outgoing header-based 
cookie name was also JSESSIONID (and their values matched).  Unfortunately, 
this did not work - could be some other config item I have set incorrectly or 
possibly some unintended consequence of the rewrite.  The app passing the 
cookie is Funambol - it is open source, but I don't have the schedule 
flexibility or experience to justify making changes to their code so, in the 
interest of time, I went in the other direction.  FWIW, I've passed along your 
feedback and my workaround to our contact there, perhaps it'll make it into the 
codebase.  Funambol suggests users use mod_jk for load balancing, so no one had 
come across this issue yet...

I appreciate your feedback and will certainly heed your warning about modifying 
requests becoming a nightmare... in time I will seek a "proper" solution 
(knowing, of course, that temporary solutions tend to be the most permanent!)

Kindest regards,

Mike

________________________________________
From: Willy Tarreau [[email protected]]
Sent: Friday, October 30, 2009 2:35 AM
To: Robinson, Michael
Cc: Aleksandar Lazic; [email protected]
Subject: Re: Sticky session, dumb client

On Wed, Oct 28, 2009 at 08:43:13PM -0400, Robinson, Michael wrote:
> Thanks again, Aleks and Willy.
>
> This is finally working - not an elegant solution, but as a workaround a 
> SERVERID cookie can be appended onto the request header using Apache 
> mod_header that mimics the one inserted by HAproxy on outgoing responses.  
> So, basically HAproxy sees a "normal" client request, and "cookie SERVERID 
> insert indirect nocache" can work as documented.  This is possible because 
> the jsessionid value passed in the URL has the originating server appended to 
> the session information already (apparently that is what mod_jk uses and our 
> software was originally written with mod_jk in mind).

OK but you apparently did not check what I suggested was wrong in your config,
which is the fact that you are using two different cookies names, "JSESSIONID"
and "jsessionid", which is the reason why it is not matched in the URL.

It should be easier to fix that than to rewrite request parts along the chain
which will become a real nightmare.

Willy

Reply via email to