Hi Cryil,

  Great thanks for you help.  I change the nbproc to 1 and it works.
 About you suggestion on the param "option http-server-close" and "option
httpclose". If i don't config it ,It still works for me. The spec saids:
By default HAProxy operates in a tunnel-like mode with regards to persistent
connections: for each connection it processes the first request and forwards
everything else (including additional requests) to selected server. Once
established, the connection is persisted both on the client and server sides.
Use "option http-server-close" to preserve client persistent connections
while handling every incoming request individually, dispatching them one
after another to servers, in HTTP close mode. Use "option httpclose" to
switch both sides to HTTP close mode. "option forceclose" and "option
http-pretend-keepalive" help working around servers misbehaving in HTTP
close mode.

 It said it processes the first request and follows to on selected server,
So we don't need to analysis the headers again. I set cookie in headers to
help check which server is selected by follows:
  cookie HTTPERVERID insert nocache indirect

 It will set the cookie "HTTPSERVERID=A" for server1 and "HTTPSERVERID=B"
for server2. If we don't click the link for a long time and the connection
is timeout, the Haproxy will reanylisis the head and send the request to the
correct server.

For this browsers that they dont support the cookie. it works same.

does my thougt is correct?

I use the
    cookie HTTPERVERID insert nocache indirect
  and
     appsession JSESSIONID len 34 timeout 1h
together. I use this cookie because I want to HAproxy to forward request to
correct server when I restart the HAproxy. All the jsessionids mapping with
backend server in the Haproxy memory will be lost when I restart it and It
will maybe forward the request to another server.

If the user browser enable supporting of cookie, there will two cookies in
the user client (HTTPSERVERID and JSESSIONID). does the HAproxy pick the
HTTPSERVERID first and send the request to the server and not set the
JSESSIONID into the hash map to the server?


Thanks again for your help.


Best ,


Hogan


On Sat, Nov 13, 2010 at 1:17 AM, Cyril Bonté <[email protected]> wrote:

> Le vendredi 12 novembre 2010 18:16:15, Cyril Bonté a écrit :
> > Also, as you're manipulating headers, you need "option httpclose" or
> > "option server-close", else only the first request of a connection will
> be
> > modified/analysed.
>
> please read "option http-server-close" ;-)
>
> --
> Cyril Bonté
>

Reply via email to