[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: Setting listen address of HAProxy as HTTP-Header?
From:       Maik Broemme <mbroemme () plusserver ! de>
Date:       2009-07-28 10:44:53
Message-ID: 20090728104453.GD24478 () bart ! intergenia ! de
[Download RAW message or body]

Hi,

Willy Tarreau <w@1wt.eu> wrote:
> On Tue, Jul 28, 2009 at 11:30:09AM +0200, Maik Broemme wrote:
> > Hi,
> > 
> > Willy Tarreau <w@1wt.eu> wrote:
> > > Hi Maik,
> > > 
> > > On Tue, Jul 28, 2009 at 12:31:23AM +0200, Maik Broemme wrote:
> > > > Hi,
> > > > 
> > > > is it possible to set the listen address of HAProxy as an HTTP-Request
> > > > Header? For example if you have HAProxys running on multiple servers and
> > > > balance the requests to multiple backend servers, which have a NAT router
> > > > between HAProxys and backend servers, it would be very nice to have a
> > > > header like 'X-Forward-Via' or 'X-Forward-From'. Did someone know if
> > > > this is possible?
> > > 
> > > you have two possibilities :
> > > 
> > >   - you know each one of your haproxy servers, so you configure them
> > >     to simply add a Via header (using reqadd with their name). Eg:
> > > 
> > >          reqadd Via:\ haproxy1
> > > 
> > 
> > Well this isn't enough, because I need the ip address.
> > 
> > >   - you just want to forward the address the client connected to,
> > >     which should match the listen address when there's only one
> > >     listen address. Then you can enable "option originalto" which
> > >     you contributed, and get this IP address in the "x-original-to"
> > >     header.
> > > 
> > 
> > Well this would be enough, if I won't use HAProxy as transparent proxy.
> > On the system running HAProxy, I will redirect the connections to
> > HAProxy with iptables and HAProxy itself will forward them to a SQUID
> > farm. Between HAProxys and the SQUIDs are some NAT-Router. The SQUID
> > itself uses some proprietary extension which relies on the IP from which
> > the HTTP connection comes.
> > 
> >   - 'X-Forward-For' gives me the client address. (Client)
> >   - 'X-Original-To' gives me the original destination address. (Webserver)
> > 
> > If HAProxy is transparent between both, what gives me that address? :)
> > 
> > PS: I have contributed the 'X-Original-To' patch, but in that setup it
> > won't help me. It wouldn't be much work, so I can also contribute a
> > patch for it.
> 
> Well, I'm a bit confused then. Which IP address would you want to see in
> your header then ?
> 

The ip address which HAProxy will use for its own outgoing connection as
source address. In a transparent HAProxy setup this isn't the original
destination address (X-Original-To)

> Willy
> 

--Maik

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic