@andyc23 said in HAProxy json-rpc healthcheck - need help with my example:
@andyc23
I solved this by having this in the advanced pass through.
Hope it helps someone else:
option httpchk POST / HTTP/1.1\r\nHost:\ haproxyservices\r\nContent-Type:\ application/json\r\nContent-Length:\ 76\r\n\r\n"{\"jsonrpc\":\"2.0\",\"method\":\"eth_syncing\",\"params\":[],\"id\":1}"
http-check expect string false
I do get a warning though >
[WARNING] 185/013305 (92736) : parsing [/var/etc/haproxy/haproxy.cfg:132]: 'option httpchk' : hiding headers or body at the end of the version string is deprecated. Please, consider to use 'http-check send' directive instead.
not sure if important.
Sorry for bumping this old thread.
I had everything working as above, but now, since i've updated haproxy -
i now get this issue:
[ALERT] (50668) : config : parsing [/var/etc/haproxy_test/haproxy.cfg:181] : 'option httpchk' : hiding headers or body at the end of the version string is unsupported.Use 'http-check send' directive instead..
i've tried:
http-check send meth POST uri / ver HTTP/1.1 hdr Host haproxyservices hdr Content-Type application/json hdr Content-Length 60 body "{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}"
http-check expect string false
anyone able to help me set the correct backend passthru?