# http frontend , backend

**URL:** <https://discourse.haproxy.org/t/http-frontend-backend/2266>\
**Category:** Help!\
**Created:** [March 19, 2018, 5:21pm UTC](https://discourse.haproxy.org/t/http-frontend-backend/2266 "2018-03-19T17:21:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluex](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@bluex](https://discourse.haproxy.org/u/bluex)\
**Post date:** [March 19, 2018, 5:21pm UTC](https://discourse.haproxy.org/t/http-frontend-backend/2266/1 "2018-03-19T17:21:25Z")

</div>

Hi,

I need to use haproxy for listening to port 80 and forward the request if it matches the role for that I did this this but I don’t know how I can tell to use the prober back end

frontend httpfw  
bind \*:80  
mode http  
acl # what I must write here to defend a domain like [test1.com](http://test1.com)  
acl # what I must write here to defend a domain like [test2.com](http://test2.com)

use\_backend httptest1 if # how can I told to use this backend if the request comes from [test1.com](http://test1.com)  
use\_backend httptest2 if # how can I told to use this backend if the request come from [test2.com](http://test2.com)

backend httptest1  
mode http  
balance source  
server httptest1 1.1.1.1:80

backend httptest2  
mode http  
balance source  
server httptest2 2.2.2.2:80

Thanks 🙂

---

<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:** [March 19, 2018, 7:37pm UTC](https://discourse.haproxy.org/t/http-frontend-backend/2266/2 "2018-03-19T19:37:26Z")

</div>

It should look like this:

```
acl test1 hdr(Host) -i test1.com
acl test2 hdr(Host) -i test2.com
use_backend httptest1 if test1
use_backend httptest2 iftest2
```
