I am trying to configure HA Proxy for Geth Ethereum RPC nodes with SSL enabled to test.example.com
I am running HA Proxy via docker image: haproxytech/haproxy-ubuntu:3.0
I have confirmed the backends work, and I have additionally confirmed a similar HA Proxy configuration without SSL (http). I believe there is something happening with how the requests are being forwarded via POST which is causing issues that I am not aware of.
There is no firewall issues either I believe.
Additionally I have confirmed that the SSL cert works in another HA Proxy config on the same server which accesses Prysm nodes (Ethereum consensus layer).
I test the HA Proxy via
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://test.example.com:8545
Invalid Host
Here is my .cfg file
global
stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
log stdout format raw local0 info
insecure-fork-wanted
external-check
defaults
mode http
timeout client 10s
timeout connect 5s
timeout server 10s
timeout http-request 10s
log global
frontend stats
bind *:8404
option httpclose
http-request use-service prometheus-exporter if { path /metrics }
stats enable
stats uri /stats
stats refresh 10s
frontend frontend
bind :80
bind :443 ssl crt /bin/cert_and_key.pem
http-request redirect scheme https unless { ssl_fc }
mode http
default_backend backend
backend backend
server node-1 1.1.1.1:8545
And my docker command is
docker run -d \
--name ethlb \
-v geth-https.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
-v /etc/letsencrypt/live/test.example.com/cert_and_key.pem:/bin/cert_and_key.pem \
-p 8545:443 \
-p 8404:8404 \
haproxytech/haproxy-ubuntu:3.0
I know there must be some specific frontend options I am missing. Can someone please assist me to get this working? Thanks!