1

In my haproxy.cfg file, I have the following config for the backend

backend app
    balance     roundrobin

    server  s1 127.0.0.1:8000 check
    server  s2 135.111.29.95:80 check

    server  b1 135.111.29.96 check backup

Yet, when I check the HAProxy stats, no health checks are being done on the backup server.

Am I just missing some line in the configuration?

Screencap of HAProxy backend stats

forkwasher
  • 75
  • 1
  • 4

1 Answers1

1

Try adding the port number for the backup server?

tater
  • 1,445
  • 2
  • 10
  • 12
  • huh. so that was easy to fix. Thanks! If the port isn't specified, the backup still works though - do you know why it has to be done like this? – forkwasher Aug 04 '20 at 16:30
  • I think if the port is not specified, it defaults to the same as the incoming connection. Because a `backend` section could be referenced by multiple `listen` sections (each listening on different ports), the port that should be checked is ambiguous. Not 100% sure, but that's my understanding. – tater Aug 04 '20 at 16:36