Hi Willy, 

thanks a lot for your help; unfortunately this did not do the trick yet. But:
…good news…
I additionally  added:
http-pretend-keepalive
and *this* in conjunction with http-server-close seemed to do the trick, though 
I admit, that I do not know why this combination exactly did it.

Thanks a bunch!
I sent you an email off-list with links to a live example, I guess this could 
be ignored for the moment and I will continue testing and let you know in case 
we need further assitance!

Best 
Michael




Am 31.10.2012 um 23:04 schrieb Willy Tarreau <[email protected]>:

> Hello Michael,
> 
> On Wed, Oct 31, 2012 at 10:05:48AM +0100, Michael Seiferle wrote:
> (...)
>> We have a customer installation where only 32bit JVMs can be run, hence we 
>> are spawning n instances of the same application on n different ports:
>> 
>>    target-machine:8766
>>    target-machine:8767
>>    target-machine:8768
>>    target-machine:8769
>> 
>> And we do have a balancer running on a dedicated `balancer` machine.
>> The clients *have* to be balanced based on IP (a legacy issue of the 
>> software we use).
>> 
>> Now we come to the ugly part: the application we intend to use, relies on the
>> `HTTP Host` header field, as some operations cause it to send an internal
>> request.
>> In our current setup this internal request goes to the load balancer, which
>> in turn sends it to one of the target machines, but necessarily to the target
>> machine it originated from.
> 
> Indeed this is quite a ugly part, because it means that this application
> will never support virtual hosting, which has been the standard in the
> HTTP world for the last 10+ years.
> 
> (...)
>> The directive adds the right server name to the header, but it seems to mess 
>> with the proxied requests as jetty closes the streams prematurely and throws 
>> `org.mortbay.jetty.EofException` as well as .
>> What I need is a Host header like:
>> 
>>    Host: target-machine:8766
>> 
>> instead of
>> 
>>    Host: balancer:8181
> 
> I have checked your config and I'm sure the issue is caused by the lack
> of "option http-server-close". This causes haproxy to only apply the
> change to the first request in a connection, so the second and next
> requests hold the original Host header again. Please add that option
> to your config and it should fix the problem.
> 
> Regards,
> Willy
> 


Reply via email to