# Helathcheck on multiple backends with virtual hostnames

**URL:** <https://discourse.haproxy.org/t/helathcheck-on-multiple-backends-with-virtual-hostnames/2413>\
**Category:** Help!\
**Created:** [April 25, 2018, 8:57pm UTC](https://discourse.haproxy.org/t/helathcheck-on-multiple-backends-with-virtual-hostnames/2413 "2018-04-25T20:57:12Z")\
**Posts on this page:** 1\
**Showing post:** 12

<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:** [May 4, 2018, 6:57am UTC](https://discourse.haproxy.org/t/helathcheck-on-multiple-backends-with-virtual-hostnames/2413/12 "2018-05-04T06:57:44Z")

</div>

> [@senattcs](#):
>
> This command instructs Cloud Foundry to only route requests to apps mapped to this route for the following URLs:
> 
> [http://myapp.shared-domain.example.com](http://myapp.shared-domain.example.com)
> 
> [https://myapp.shared-domain.example.com](https://myapp.shared-domain.example.com)
> 
> Any path under either of the above URLs, such as [http://myapp.shared-domain.example.com/bar](http://myapp.shared-domain.example.com/bar)

That I understood. What I do not understand is how you expect your customers host header to be different for one server as opposed to another when haproxy is load balancing to different servers?

More specifically, how is the browser/app-client/customer supposed to send `customerlookup.xxx.px-prd02.cf.xxxx.com:443` for one server and `customerlookup.xxx.px-prd03.cf.xxxx.com:443` for the other?

I’m sure you have a valid use-case, I just not understand it yet.

> [@senattcs](#):
>
> I didn’t understand how to outsource the HK to dedicated backend. would appreciate if you can share a sample.

It would look like this for example:

```
backend check_customerlookup.xxx.px-prd02.cf.xxxx.com
 option httpchk GET /env HTTP/1.1\r\nHost:\ customerlookup.xxx.px-prd02.cf.xxxx.com:443\r\n
 server prd02 192.168.211.13:8080 cookie server1 maxconn 1000 check inter 5000

backend check_customerlookup.xxx.px-prd03.cf.xxxx.com
 option httpchk GET /env HTTP/1.1\r\nHost:\ customerlookup.xxx.px-prd03.cf.xxxx.com:443\r\n
 server prd03 192.168.211.14:8080 cookie server1 maxconn 1000 check inter 5000

backend app1
 server talaiaclu01-app1 192.168.211.13:8080 cookie server1 maxconn 1000 track check_customerlookup.xxx.px-prd02.cf.xxxx.com/prd02
 server talaiaclu02-app1 192.168.211.14:8080 cookie server2 maxconn 1000 track check_customerlookup.xxx.px-prd03.cf.xxxx.com/prd03

```

---

_[View the full topic](https://discourse.haproxy.org/t/helathcheck-on-multiple-backends-with-virtual-hostnames/2413)._
