# Help me with ACL

**URL:** https://discourse.haproxy.org/t/help-me-with-acl/3413
**Category:** Help!
**Created:** [January 17, 2019, 3:31pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413 "2019-01-17T15:31:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![lucas\_yanez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/lucas_yanez/32/727_2.png) [@lucas\_yanez](https://discourse.haproxy.org/u/lucas_yanez)
#### Post date: [January 17, 2019, 3:31pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/1 "2019-01-17T15:31:10Z")

</div>

I got:  
acl host\_bacon hdr(host) -i re\*\*\*\*\*.l\ ***e.**  
acl host\_milkshake hdr(host) -i u.y\*\*\*.\*\*\*  
use\_backend bacon\_cluster if host\_bacon  
^^ alreday.

I want the folder “reports” in host\_bacon to go to another server. Only the folder “reports”.  
How to make this?

---

<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 17, 2019, 3:44pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/2 "2019-01-17T15:44:55Z")

</div>

Use path\_beg and combine the ACLs in another use\_backend statement:

```
acl folder-reports path_beg /reports/
acl host_bacon hdr(host) -i re *****.l*** e.**
acl host_milkshake hdr(host) -i u.y ***.***
use_backend another_server if host_bacon folder-reports
use_backend bacon_cluster if host_bacon
```

---

<div class="post-metadata">

### Author: ![lucas\_yanez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/lucas_yanez/32/727_2.png) [@lucas\_yanez](https://discourse.haproxy.org/u/lucas_yanez)
#### Post date: [January 18, 2019, 8:31am UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/3 "2019-01-18T08:31:47Z")

</div>

I get this error:

# 503 Service Unavailable

No server is available to handle this request.

It works on /reports. But then i go into other folds in the webserver I get 503 error.

---

<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 18, 2019, 9:06am UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/4 "2019-01-18T09:06:06Z")

</div>

That was an example above. You need to read, understand and have the corresponding backend for that ACL statement.

Share the _entire_ configuration if you have additional questions.

---

<div class="post-metadata">

### Author: ![lucas\_yanez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/lucas_yanez/32/727_2.png) [@lucas\_yanez](https://discourse.haproxy.org/u/lucas_yanez)
#### Post date: [January 18, 2019, 9:34am UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/5 "2019-01-18T09:34:38Z")

</div>

> ```
> frontend http-in
> bind :::80
> 
> # Define hosts
> acl reports_cluster path_beg /reports/
> acl host_bacon hdr(host) -i reports. *****.**
> acl host_milkshakes hdr(host) -i u. *****.**
> 
> #2
> use_backend bacon_cluster if host_bacon
> use_backend bacon_cluster if host_bacon
> 
> backend bacon_cluster
> balance leastconn
> option http-server-close
> option forwardfor
> cookie JSESSIONID prefix
> server node1 79. ***.**.***:88 cookie A check
> 
> backend milshake_cluster
> balance leastconn
> option http-server-close
> option forwardfor
> cookie JSESSIONID prefix
> server node1 79. ***.**.***:89 cookie A check
> 
> backend reports_cluster
> balance leastconn
> option http-server-close
> option forwardfor
> cookie JSESSIONID prefix
> server node1 92.***.*'6.*19:80 cookie A check
> 
> ```

My config.  
When i go into reports._ **./reports in my web browser, and go to /reports, I want it to go to the server 92.** _. **6.** \*:80.  
The folder reports to go to the IP-address 92.  
Have a great day.

---

<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 18, 2019, 1:13pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/6 "2019-01-18T13:13:31Z")

</div>

```auto
 use_backend reports_cluster if host_bacon reports_cluster

```

Not that you are using `reports_cluster` as name for the backend and as ACL name. That’s highly confusing, please don’t do this.

---

<div class="post-metadata">

### Author: ![lucas\_yanez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/lucas_yanez/32/727_2.png) [@lucas\_yanez](https://discourse.haproxy.org/u/lucas_yanez)
#### Post date: [January 18, 2019, 6:14pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/7 "2019-01-18T18:14:41Z")

</div>

Hi.

Sorry for confusing you.  
I did sorted everyting in my config - and then it worked! 😉  
Thank you 😃

But I do got a little problem now.  
When I test if the proxy leaks the webserver IP-address, it unfortunately does.  
Server IP: 92.6…

How to hide this?

---

<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 18, 2019, 7:43pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/8 "2019-01-18T19:43:10Z")

</div>

I don’t know what that means, can you elaborate?

The webserver will always see the IP address of haproxy, unless you send X-Forwarded-For header or the PROXY protocol to the backend webserver _and that webserver_ uses it instead of the source IP address of the socket.

---

<div class="post-metadata">

### Author: ![lucas\_yanez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/lucas_yanez/32/727_2.png) [@lucas\_yanez](https://discourse.haproxy.org/u/lucas_yanez)
#### Post date: [January 18, 2019, 8:00pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/9 "2019-01-18T20:00:39Z")

</div>

I created a phpinfo.php on the web server/IP-address, (the web server that handles specific /reports folder.)  
On “SERVER\_ADDR” it shows the IP-address of the webserver.  
How can I hide it?

Is it possible to make this IP-address to a “192.168.1.x” IP-address for example?  
It’s a VPS, virtualization OpenVZ.

---

<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 18, 2019, 8:11pm UTC](https://discourse.haproxy.org/t/help-me-with-acl/3413/10 "2019-01-18T20:11:56Z")

</div>

This has nothing to do with haproxy at all.

You are in control of the webserver, to not show SERVER\_ADDR, just don’t provide any publicly available script showing that variable, especially a phpinfo file.

But again, this is completely unrelated to haproxy.
