# Check just one backend, node down in all

**URL:** https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492
**Category:** Help!
**Created:** [August 4, 2017, 6:45pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492 "2017-08-04T18:45:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![devnull82](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@devnull82](https://discourse.haproxy.org/u/devnull82)
#### Post date: [August 4, 2017, 6:45pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/1 "2017-08-04T18:45:46Z")

</div>

Hello,  
I have an haproxy configuration with 2 frontend (http and https) pointing to two different backends (http and https), but having exactly the same nodes.

As it seems I can’t configure an healthy check on https, I’d like to consider down even on https the node that fails the check on http.

Is it possible to do it in some way?

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: [August 4, 2017, 9:18pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/2 "2017-08-04T21:18:47Z")

</div>

Why don’t you use the same backend for both frontends?

Health check should work just fine, why don’t you share your configuration?

---

<div class="post-metadata">

### Author: ![devnull82](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@devnull82](https://discourse.haproxy.org/u/devnull82)
#### Post date: [August 5, 2017, 3:44am UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/3 "2017-08-05T03:44:54Z")

</div>

I could… how? 🙂

I solved the problem, with yum on centos haproxy didn’t have openssl support. I compiled it with openssl support and my checks are now working. Anyway, this is my configuration, if it’s possible to make it more simple having just a backend it could be better!

global  
daemon  
log 127.0.0.1 local2

listen stats  
bind \*:1988  
mode http  
stats enable  
stats hide-version  
stats realm Haproxy\ Statics  
stats uri /haproxy  
stats auth username:password  
timeout connect 4000  
timeout client 42000  
timeout server 43000

frontend ft\_http  
bind :80  
mode http  
default\_backend bk\_http

frontend ft\_https  
bind :443  
mode tcp  
default\_backend bk\_https

backend bk\_http  
mode http  
cookie SERVERID insert nocache indirect  
option tcp-check  
tcp-check send GET\ /myhttpcheck\ HTTP/1.1\r\n  
tcp-check send Host:\ node1\r\n  
tcp-check send Connection:\ close\r\n  
tcp-check send \r\n  
tcp-check expect string php\_mysql\_up  
server main1 node1:80 weight 1 cookie main1 check  
server main2 node2:80 weight 1 cookie main2 check  
server backup node3:80 backup check  
balance roundrobin  
option redispatch  
option forwardfor  
timeout connect 4000  
timeout client 42000  
timeout server 43000

backend bk\_https  
mode tcp  
stick-table type ip size 1m expire 1h  
stick on src  
option tcp-check  
tcp-check send GET\ /myhttpscheck\ HTTP/1.1\r\n  
tcp-check send Host:\ node1\r\n  
tcp-check send Connection:\ close\r\n  
tcp-check send \r\n  
tcp-check expect string php\_mysql\_up  
server main1 node1:443 weight 1 cookie main1 check check-ssl verify none  
server main2 node2:443 weight 1 cookie main2 check check-ssl verify none  
server backup node3:443 backup check check-ssl verify none  
balance roundrobin  
timeout connect 4000  
timeout client 42000  
timeout server 43000

---

<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: [August 6, 2017, 1:08pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/4 "2017-08-06T13:08:57Z")

</div>

You install the SSL certificate on haproxy and terminate SSL there (instead of terminating it on Apache an forwarding port 443 TCP traffic).

like:

```
frontend ft_https
 bind :443 ssl crt /path/to/certificate
 mode tcp
 default_backend bk_http
```

---

<div class="post-metadata">

### Author: ![devnull82](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@devnull82](https://discourse.haproxy.org/u/devnull82)
#### Post date: [August 6, 2017, 1:21pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/5 "2017-08-06T13:21:12Z")

</div>

That’s an option, but how does it help with the problem I have?

---

<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: [August 6, 2017, 2:04pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/6 "2017-08-06T14:04:14Z")

</div>

What is the problem you are having?

I was under the assumption that you fixed the ssl health check by having compiled haproxy with openssl.

---

<div class="post-metadata">

### Author: ![devnull82](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@devnull82](https://discourse.haproxy.org/u/devnull82)
#### Post date: [August 6, 2017, 2:18pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/7 "2017-08-06T14:18:36Z")

</div>

Yes, sorry… I solved it, but I wanted to understand anyway if it was possible to have just one ckeck on the nodes, and consider that node down for every backend if it’s down on the main one.

But I just saw the “track” command could be what I was looking for:

Track  
This option enables ability to set the current state of the server by  
tracking another one. Only a server with checks enabled can be tracked  
so it is not possible for example to track a server that tracks another  
one. If is omitted the current one is used. If disable-on-404 is  
used, it has to be enabled on both proxies.

---

<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: [August 6, 2017, 2:24pm UTC](https://discourse.haproxy.org/t/check-just-one-backend-node-down-in-all/1492/8 "2017-08-06T14:24:44Z")

</div>

If you have just one backend, that solves this exact problem, doesn’t it?

If you have to use multiple backends for other reasons, then you can use the track option, thats correct.
