# HAProxy backend server respond with different URI than the acl path\_beg

**URL:** <https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779>\
**Category:** Help!\
**Created:** [January 28, 2020, 3:04pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779 "2020-01-28T15:04:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![abbas.ali](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@abbas.ali](https://discourse.haproxy.org/u/abbas.ali)\
**Post date:** [January 28, 2020, 3:04pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/1 "2020-01-28T15:04:16Z")

</div>

I have configured HAProxy as below:

```
    acl has_env_appslogs path_beg -i /test
    use_backend backend_env_pool_appslogs if has_env_appslogs

    backend backend_env_pool_appslogs
        server env_APP_Logs_2 <hostname>:9999 check

```

when I browse https://\<haproxy\_host\>/ **test** it brings me to the backend server’s login page.  
After entering user & pass in the login page … it generates a HTTP POST request to https://\<haproxy\_host\>/ **login** …. which can’t handle HAProxy. It says below:  
[ 503 Service Unavailable  
No server is available to handle this request.]

**How can I handle this in HAProxy [Like in the middle of backend server communication] ?**

**Similar request** : [Rewrite urls for response with absolute urls](https://discourse.haproxy.org/t/rewrite-urls-for-response-with-absolute-urls/513)

---

<div class="post-metadata">

**Author:** ![ethnical](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@ethnical](https://discourse.haproxy.org/u/ethnical)\
**Post date:** [February 2, 2020, 10:00am UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/2 "2020-02-02T10:00:36Z")

</div>

Hi !  
I finally found someone who handle the same issue as me ! I was googling during hour but found only Ngix solutions…  
I’m trying to configure a splunk but like you because of absolute url i’m request content without the prefix (/test) or for me ("/MySplunk") so can’t find the good page.  
If you find out what we need to do could you notify me please ? 😛

Good weekend !

---

<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:** [February 2, 2020, 10:06am UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/3 "2020-02-02T10:06:13Z")

</div>

Use different hostnames or configure your backend application in a way to let it know it doesn’t run in the root path `/`.

Otherwise you’d have to rewrite the entire HTML content, cookies, etc, which haproxy will not do.

---

<div class="post-metadata">

**Author:** ![ethnical](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@ethnical](https://discourse.haproxy.org/u/ethnical)\
**Post date:** [February 2, 2020, 10:14am UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/4 "2020-02-02T10:14:06Z")

</div>

Thanks ! But i don’t know how to ‘chroot’ my web application that’s why i was looking for Haproxy solution…  
Thanks by the way !

---

<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:** [February 2, 2020, 10:16am UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/5 "2020-02-02T10:16:27Z")

</div>

Haproxy will not do that for you.

---

<div class="post-metadata">

**Author:** ![abbas.ali](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@abbas.ali](https://discourse.haproxy.org/u/abbas.ali)\
**Post date:** [February 2, 2020, 3:43pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/6 "2020-02-02T15:43:43Z")

</div>

It was an easy solution for me.

In the ACL I have added multiple path(URI) to use the same backend.

```
acl has_env_appslogs path_beg /test /login
    use_backend backend_env_pool_appslogs if has_env_appslogs

    backend backend_env_pool_appslogs
        server env_APP_Logs_2 <hostname>:9999 check

```

Reference: [http://cbonte.github.io/haproxy-dconv/1.8/configuration.html#7.2](http://cbonte.github.io/haproxy-dconv/1.8/configuration.html#7.2)

---

<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:** [February 2, 2020, 3:54pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/7 "2020-02-02T15:54:53Z")

</div>

That’s works as long as the application does not use absolute links or cookies with specific paths.

---

<div class="post-metadata">

**Author:** ![abbas.ali](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@abbas.ali](https://discourse.haproxy.org/u/abbas.ali)\
**Post date:** [February 2, 2020, 4:13pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-respond-with-different-uri-than-the-acl-path-beg/4779/8 "2020-02-02T16:13:37Z")

</div>

Yes… My application does not use absolute links and there is no path specific cookie.
