i am testing using http/2 on backend side. So on ssl backend:
option httpchk HEAD / HTTP/1.1\r\nHost:\ serverA.domain.fqdn\r\n\User-Agent:\ serverA
server serverA ipA:443 check ssl verify none maxconn 1000 alpn h2,http/1.1
This works, if nginx has only http/1.1 enabled.
When i change to
option httpchk HEAD / HTTP/2.0\r\nHost:\ serverA.domain.fqdn\r\n\User-Agent:\ serverA
it still works.
But, when i enable “alpn http2” on nginx side, haproxy fails to checks with L7RSP. What’s correct way to check via http/2 or better way (i am checking working php/source codes availability too). Tested with all headers lowercase and failed too.
While a bit hackish it’s possible to perform h2 checks before haproxy 2.2. It won’t scale well with a lot of servers though. The idea is to check through an htx enabled listener, and h1 checks are translated to h2 by the listener before they hit your server.