`path_sub` Networking

Hi everybody,

I want to route my requests according to its final destination regarding both the dns of the endpoint targeted or/and some part of the url path. I have not found satisfying results using the following config :

I have tried path_beg, path_end, path_sub with the following config :

        bind *:8080
        mode http
        acl admin_url path_sub admin

        use_backend srvs_app1 if admin_url

backend srvs_app1
        balance leastconn
        server host1 HOST1_IP:PORT1 check
        server host2 HOST2_IP:PORT2 check

and this one too :

frontend frontend-base
        bind 0.0.0.0:4030
        acl is_monip path_sub -i ip
        use_backend app if is_monip

backend backend-base
        balance            random two
        balance            leastconn

        server             web-01 HOST1_BCK:PORT1_BCK check
        server             web-02 HOST2_BCK:PORT2_BCK check
     

backend app
        balance            random two
        balance            leastconn
        server             web-03 HOST1_APP:PORT1_APP check
        server             web-04 HOST2_APP:PORT2_APP check

path_sub does not seam to work, any advise ?

you might want to use hdr(host) to match the “DNS” name pointing to HAProxy