Re: question about load balance and forwardfor

From: Alberto Giménez <lagimenez#gmail.com>
Date: Tue, 1 Jul 2008 20:45:21 +0200


On Tue, Jul 1, 2008 at 9:51 AM, Cherife Li <cherife#dotimes.com> wrote:
> Hi, all.
>
> I haven't understood haproxy in some points.

Hi, Cherife,

> 1. If I enable both cookie-based persistence and any one of the load balance
> algorithm, then, how does haproxy select a backend?

AFAIK, if no cookie is seen, the algorithm takes place. Cookie is inserted/rewritten/whatever, and for further requests, cookie takes precedence.

> 2. Situation is 'user requests' -> varnish -> haproxy -> backends, is it
> possible for haproxy to do 'source' balance? Cause I didn't find a way to
> let haproxy use the X-FORWARDED-FOR header sent by varnish. It seems that
> haproxy only captures the header in log using "capture request header
> X-Forwarded-For", right?

I don't know what is "varnish". I guess it's kind of SSL terminator or whatever you put "in front of" haproxy and inserts the header by itself. Tell haproxy to insert X-Forwarded-For header except for the machine that runs the "varnish" thing:

option xforwardfor except "machine_ip"

Check the documentation for a better explanation ;)

Best regards,

-- 
Alberto Giménez
Received on 2008/07/01 20:45

This archive was generated by hypermail 2.2.0 : 2008/07/01 21:01 CEST