# HA Proxy ACL for URL matching dynamically

**URL:** https://discourse.haproxy.org/t/ha-proxy-acl-for-url-matching-dynamically/157
**Category:** Help!
**Created:** [March 8, 2016, 5:38pm UTC](https://discourse.haproxy.org/t/ha-proxy-acl-for-url-matching-dynamically/157 "2016-03-08T17:38:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![souvikbhattacharyas](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@souvikbhattacharyas](https://discourse.haproxy.org/u/souvikbhattacharyas)
#### Post date: [March 8, 2016, 5:38pm UTC](https://discourse.haproxy.org/t/ha-proxy-acl-for-url-matching-dynamically/157/1 "2016-03-08T17:38:42Z")

</div>

Recently I have gone through HA Proxy ACL details and need help with a specific scenario. My scenario is given below.

My URL’s will be like [https://companyName.research.com/index](https://companyName.research.com/index).  
Company name is dynamic today I have 2 companies and later it may reach  
to [hundred.In](http://hundred.In) the ACL section it normally checks in URL that if any  
particular String exist or not and according to that forward to back  
end. This configurations are not dynamic. Like I have one URL start with  
blog then will forward it to blog back end. But my scenario is  
completely different. Here system will check is any company name exist  
or not if exist then it will forward the request to the back end with  
that company name dynamically. Like if company dummy given forward it to dummy.  
But as I said company names are not known to me so, it’s ha proxy which  
will fetch the company name from url and will find the suitable backend  
with name matching and will forward. Is that possible with HA Proxy.

---

<div class="post-metadata">

### Author: ![ahayworth](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ahayworth/32/11_2.png) [@ahayworth](https://discourse.haproxy.org/u/ahayworth)
#### Post date: [March 21, 2016, 9:09pm UTC](https://discourse.haproxy.org/t/ha-proxy-acl-for-url-matching-dynamically/157/2 "2016-03-21T21:09:34Z")

</div>

Hi souvikbhattacharyas -

Yes, such a configuration is possible. You probably want to investigate map files in the configuration, and ACLs: [https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#7](https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#7)

Specifically a configuration like:

```auto
acl known_company path -i -m beg -M -f /etc/haproxy/known_backends.lst
use_backend %[path,map_beg(/etc/haproxy/known_backends.lst)] if known_company
default_backend some_other_backend

```

…might do the trick (I haven’t checked that for accuracy, but that’s the idea).

Hope that helps!

- Andrew
