# Haproxy use\_backend condition (acl) is missing the backend

**URL:** <https://discourse.haproxy.org/t/haproxy-use-backend-condition-acl-is-missing-the-backend/4690>\
**Category:** Help!\
**Created:** [January 4, 2020, 5:59am UTC](https://discourse.haproxy.org/t/haproxy-use-backend-condition-acl-is-missing-the-backend/4690 "2020-01-04T05:59:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fahadahammed](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/fahadahammed/32/1051_2.png) [@fahadahammed](https://discourse.haproxy.org/u/fahadahammed)\
**Post date:** [January 4, 2020, 5:59am UTC](https://discourse.haproxy.org/t/haproxy-use-backend-condition-acl-is-missing-the-backend/4690/1 "2020-01-04T05:59:21Z")

</div>

I have an application which I installed in two servers for balancing issue.

I wanted to route the traffic like below:

server 1: client server 2: admin

server 1 app config: host: 192.168.0.101 port: 5031

server 2 app config: host: 192.168.0.102 port: 5032

Application is same in both servers with same database connection.

I installed haproxy in 192.168.0.101 with port 5033 and setup:

```
frontend hh-test
        bind 192.168.0.101:5033
        mode tcp
        option tcplog
        acl is_admin path_reg ^/admin/sales$
        use_backend server2 if is_admin
        default_backend server1

backend server2
        mode tcp
        server admin 192.168.0.102:5032

backend server1
        mode tcp
        server client 192.168.0.101:5031

```

It does work. When I access [http://192.168.0.101:5033](http://192.168.0.101:5033/) It serves from Server 1 and when I access [http://192.168.0.101:5033/admin/sales](http://192.168.0.101:5033/admin/sales) it serves from server2 …as expected. But some request goes to server1 accessing same /admin/sales url. Very few. I am not sure what I am doing wrong that some request goes to the other backend. Can I have an insight please?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 4, 2020, 10:24am UTC](https://discourse.haproxy.org/t/haproxy-use-backend-condition-acl-is-missing-the-backend/4690/2 "2020-01-04T10:24:42Z")

</div>

You need to use `mode http` here, otherwise haproxy cannot reliably extract the URI.

---

<div class="post-metadata">

**Author:** ![fahadahammed](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/fahadahammed/32/1051_2.png) [@fahadahammed](https://discourse.haproxy.org/u/fahadahammed)\
**Post date:** [January 4, 2020, 10:49am UTC](https://discourse.haproxy.org/t/haproxy-use-backend-condition-acl-is-missing-the-backend/4690/3 "2020-01-04T10:49:12Z")

</div>

I think it is working now. Thank you, thanks a lot. @lukastribus Let me implement it in production and update the solution here.
