On Thu, May 3, 2012 at 6:48 PM, Francois-Guillaume Ribreau <
francoisguillaume-ribr...@fgribreau.com> wrote:

> In fact I started with an new fresh configuration without all those
> options and now it works well (I still have http-server-close &
> forceclose). But I had to remove the "default_backend nginx" directive
> because it was the root issue. Sometimes HAProxy was going through the acls
> (below) without selecting the right backend (gateway_bringr). Thus, it was
> falling back to the default_backend (nginx) and that's why the 502 errors
> were coming (see http://pastebin.com/yHHkJpcX )
>
> acl is_gateway_bringr hdr_dom(host) -i gateway.brin.gr
> acl is_gateway_bringr hdr_dom(host) -i gateway.bringr.dev
>
>
That's precisely why I told you to turn your frontend in HTTP because I
suspected these ACL always return 0 in TCP mode.
(but did not seem to be related).


>
> I don't understand your answer ( I'm new to HAProxy ) because
> gateway_bringr is an http and websockets server so it should have "option
> http-server-close" and "option forceclose" isn't it ?
>
>
When using HAProxy with the option http-server-close or forceclose, haproxy
will close the TCP conection on either the server or both the client and
the server, after each request. Which is not compatible with websocket.
When none of these options are enabled, then haproxy will maintain a single
TCP connection between the client and the server, analyzing the first
request only.
To my mind, HAProxy is able to detect the websocket and to failover to
tunnel mode even if the backend is configured with server-close option.


And I'm running HA-Proxy v1.4.15.
>
>
ok, the latest production version in 1.4 is 1.4.20, one fix might deserve a
try of this version, in 1.4.18, Willy improved *_dom ACLs to match the ':'
as well.
You could give a try to hdr_sub.
By the way, I think you're misusing hdr_dom.
You should use it like that:
   acl is_gateway_bringr hdr_dom(host) -i brin bringr
At least, this is my understanding of the documentation :)


cheers



> On Wed, May 2, 2012 at 11:48 PM, Baptiste <bed...@gmail.com> wrote:
>
>> on the backend gateway_bringr, please comment the http-server-close
>> option as well as forceclose.
>> It will turn this backend in tunnel mode.
>>
>> As far as I remember, haproxy fails back automatically to the tunnel mode
>> for websockets opened in a backend in "http-server-close" mode.
>> But I don't know from which version of haproxy it is available...
>>
>> Which version are you running?
>> What does the log says???
>>
>> cheers
>>
>>
>> On Tue, May 1, 2012 at 1:26 AM, Francois-Guillaume Ribreau <
>> francoisguillaume-ribr...@fgribreau.com> wrote:
>>
>>> Thanks for your answer
>>>
>>> However, I removed the "mode tcp" line from the frontend block and I
>>> still have the same issue.
>>>
>>> Do you have any other ideas ?
>>>
>>> Thanks
>>>
>>>
>>> On Mon, Apr 30, 2012 at 11:20 PM, Baptiste <bed...@gmail.com> wrote:
>>>
>>>> On Mon, Apr 30, 2012 at 3:17 PM, Francois-Guillaume Ribreau
>>>> <francoisguillaume-ribr...@fgribreau.com> wrote:
>>>> > On the main page of my website multiple http requests are made on
>>>> different
>>>> > domains (brin.gr, static.brin.gr and gateway.brin.gr).
>>>> > Sometimes everything's fine, sometimes the http request to
>>>> gateway.brin.gr
>>>> > returns 502.
>>>> >
>>>> > I've started HAProxy in debug mode and found out that the 502 error
>>>> occur
>>>> > when the request is done on the wrong backend (the request is done on
>>>> > default backend "nginx" instead of "gateway"),
>>>> > see http://pastebin.com/yHHkJpcX.
>>>> >
>>>> > So it seems to be a configuration issue. FYI Gateway.brin.gr is
>>>> process that
>>>> > act as an http server and a websocket server and runs on the local
>>>> port
>>>> > 8080.
>>>> >
>>>> > Here is the configuration file: http://pastebin.com/ddmDzZLG
>>>> >
>>>> > You can try accessing http://brin.gr by yourself and see that
>>>> sometimes the
>>>> > request gateway.brin.gr will throw a 502 error.
>>>> >
>>>> > What did I do wrong ?
>>>> >
>>>> > Thanks a lot for your time.
>>>>
>>>> Hi,
>>>>
>>>> It may be due because your frontend is in TCP mode and I'm almost sure
>>>> that HTTP acls will always return 0.
>>>> Maybe Willy will confirm, or not :)
>>>>
>>>> cheers
>>>>
>>>
>>>
>>>
>>> --
>>> Francois-Guillaume Ribreau  [image: LinkedIn]
>>> <http://www.linkedin.com/in/francoisguillaumeribreau> 
>>> <http://www.doyoubuzz.com/francois-guillaume-ribreau>  [image:
>>> Twitter] <http://twitter.com/FGRibreau> [image: Site]
>>> <http://fgribreau.com/> 
>>> <http://www.viadeo.com/fr/profile/francois-guillaume.ribreau>  [image:
>>> Blog] <http://blog.fgribreau.com/>
>>>
>>>
>>
>
>
> --
> Francois-Guillaume Ribreau  [image: LinkedIn]
> <http://www.linkedin.com/in/francoisguillaumeribreau> 
> <http://www.doyoubuzz.com/francois-guillaume-ribreau>  [image:
> Twitter] <http://twitter.com/FGRibreau> [image: Site]
> <http://fgribreau.com/> 
> <http://www.viadeo.com/fr/profile/francois-guillaume.ribreau>  [image:
> Blog] <http://blog.fgribreau.com/>
>
>

Reply via email to