I am setting up HAproxy LB in AWS environment as I am unable to use ELB. This is the requirement which forced me to go for HAproxy route: There are multiple websites that will run on one server. The websites needs to run over https. The site code requires https connection to reach it. It redirects if http code reaches it. So I have to bind each website to a unique IP and have SSL termination there.
This is what I am doing right now:
2 subnets:
HAproxy subnet is public and Webserver subnet is private
All traffic from the webserver is being routed to the instance running HAproxy. For testing, I have just added one site to HAproxy. I am terminating the connection at HAproxy first, de-crypting it, reading the host value and then based on that redirecting it to the IP with which that website has been mapped on the webserver over https. This is the existing config:
frontend https_traffic
bind 10.100.210.229:443 ssl crt /ssl/converted.pem
log global
option tcplog
option dontlognull
timeout client 30s
use_backend secure_traffic1 if { hdr(host) -i work.xyzsite.net }
backend secure_traffic1
balance roundrobin
retries 2
stick-table type binary len 32 size 30k expire 30m
stick on ssl_fc_session_id
timeout connect 5s
timeout server 5s
option ssl-hello-chk
server web1 10.100.10.16:443 ssl verify none
When I open the URL, most of the times I get "ERR_EMPTY_RESPONSE" in my browser, and the other times the site loads properly. I set haproxy log level to debug but don't see any errors in the logs.
Please help.