Baptiste, thanks -- seems to work, but is it supposed to work for both
blah.foo.com, and foo.com ? .. Because that doesn't seem to be the case, so
i need both '.foo.com', and 'foo.com', in my map.

Is that correct?

Also a quick question regarding acl's and fetching -- is there any way this
could be written with an acl first, and then a use_backend declaration?

Something like:

acl is_worker hdr_dom(Host),map(/etc/haproxy/worker.map),lower
use_backend ??? if is_worker

This is just to get a better understanding of how acl's work with maps, and
how to perform lookups, and storing them for later use.



On Wed, Jun 3, 2015 at 5:03 PM, Baptiste <[email protected]> wrote:

> hi Jim,
>
> hdr_end could do the trick if you include the '.' in the matching string.
>
> Baptiste
>
>
> On Wed, Jun 3, 2015 at 4:55 PM, Jim Gronowski <[email protected]>
> wrote:
> > I’m not very familiar with the map function, but does hdr_end(host) work
> in
> > this context?
> >
> >
> >
> > If so, in order to only match *.foo.com and not blahfoo.com, you’d need
> to
> > include the dot in your map – ‘.foo.com’ instead of ‘foo.com’.
> >
> >
> >
> >
> >
> > From: David Reuss [mailto:[email protected]]
> > Sent: Wednesday, June 03, 2015 05:23
> > To: [email protected]
> > Subject: Dynamic backend selection using maps
> >
> >
> >
> > Hello,
> >
> >
> >
> > I have this use_backend declaration:
> >
> >
> >
> > use_backend
> > %[req.hdr(host),lower,map_dom(/etc/haproxy/worker.map,b_nodes_default)]
> >
> >
> >
> > Which seems to work wonderfully, but say i have "foo.com" in my map, it
> will
> > match foo.com.whatever.com, and ideally i'd like to only match if the
> domain
> > ends with my value (foo.com), and also, it should NOT match blahfoo.com
> >
> >
> >
> > How would i achieve that?
> >
> >
> >
> > Ditronics, LLC email disclaimer:
> > This communication, including attachments, is intended only for the
> > exclusive use of addressee and may contain proprietary, confidential, or
> > privileged information. Any use, review, duplication, disclosure,
> > dissemination, or distribution is strictly prohibited. If you were not
> the
> > intended recipient, you have received this communication in error. Please
> > notify sender immediately by return e-mail, delete this communication,
> and
> > destroy any copies.
>

Reply via email to