# \`path\_sub\` Networking

**URL:** <https://discourse.haproxy.org/t/path-sub-networking/7708>\
**Category:** Help!\
**Created:** [June 1, 2022, 7:55am UTC](https://discourse.haproxy.org/t/path-sub-networking/7708 "2022-06-01T07:55:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GabriMartin](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@GabriMartin](https://discourse.haproxy.org/u/GabriMartin)\
**Post date:** [June 1, 2022, 7:55am UTC](https://discourse.haproxy.org/t/path-sub-networking/7708/1 "2022-06-01T07:55:17Z")

</div>

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 :

```auto
        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 :

```auto
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 ?

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [June 1, 2022, 9:05am UTC](https://discourse.haproxy.org/t/path-sub-networking/7708/2 "2022-06-01T09:05:22Z")

</div>

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