HAProxy mixture of wildcard and specific url's to different backends
I have the following two frontend configuration statements in HAProxy.
acl auth_domain hdr(host) -m reg -i ^auth\.web\.simoncarr\.co\.uk$
acl k8s_domain hdr(host) -m reg -i ^[^\.]+\.web\.simoncarr\.co\.uk$
The first line checks for the specific domain auth.web.simoncarr.co.uk
, the second checks for *.web.simoncarr.co.uk
Individually they both work fine, but I if both are included and no matter what order, the wildcard always wins.
Is it possible to do this?
Solution 1:
I found the solution by editing my wild card as below.
acl k8s_domain hdr(host) -m reg -i ^(?!auth)[^\.]+\.web\.simoncarr\.co\.uk$