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:shuffle...@gmail.com]
Sent: Wednesday, June 03, 2015 05:23
To: haproxy@formilux.org
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<http://foo.com>" in my 
map, it will match foo.com.whatever.com<http://foo.com.whatever.com>, and 
ideally i'd like to only match if the domain ends with my value 
(foo.com<http://foo.com>), and also, it should NOT match 
blahfoo.com<http://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