Hello everyone!
I wonder if there is a way to use %[...] syntax in use-server directives.
backend be_template
server-template websrv 1-100 localhost:6666 check disabled
use-server
%[req.hdr(host),lower,map_dom(/usr/local/etc/haproxy/domain2server.map,websrv0)]
if { req.hdr(host),lower,map_dom(/usr/local/etc/haproxy/domain2server.map)
-m found }
Right now, using the above makes haproxy fail at startup with the following
error:
haproxy_1 | [ALERT] 048/161559 (1) : config : backend 'be_template' :
unable to find server
'%[req.hdr(host),lower,map_dom(/usr/local/etc/haproxy/domain2server.map,websrv0)]'
referenced in a 'use-server' rule.
haproxy_1 | [ALERT] 048/161559 (1) : Fatal errors found in configuration.
Just in case, I've also asked the same question on the forum:
https://discourse.haproxy.org/t/in-use-server/3529