Unexpected error message

I am trying to configure health checks for my back-end using http-check send meth POST, but get the following errors when running haproxy -c:

[ALERT] 115/082934 (182726) : parsing [/etc/haproxy/haproxy.cfg:57] : 'http-check' only supports 'disable-on-404', 'send-state', 'expect'.
[ALERT] 115/082934 (182726) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 115/082934 (182726) : Fatal errors found in configuration.

Whenever I try to use any other argument than the disable-on404, send-state, and expect, I receive the above errors. I am using non-enterprise version of haproxy, but as far as I understand, limitations to these health checks shouldn’t apply.

haproxy -v:

HA-Proxy version 2.0.13-2ubuntu0.5 2022/03/02

backend section:

backend internal_node
        mode http
        option httpchk
        http-check connect
        http-check send meth POST  hdr Content-Type: application/json
        http-check expect status 200
        server my_node 3.145.84.115:5522 check inter 1s fall 3 rise 2

If I leave out connect and send, the configuration file validates. I just don’t understand why since this is taken straight from the docs

My frontend:

frontend ingress
        mode http
        bind :5522
        acl is_internal_node_alive nbsrv(internal_node) -m int gt 0
        use_backend internal_node if is_internal_node_alive
        use_backend onfinality

It is the doc for the 2.5. You must use the documentation corresponding to your version. On the 2.0, HTTP and TCP health-checks are limited. Health-checks engine was reworked in HAProxy 2.2.

1 Like