Just set up HAProxy for the first time, as a single load balancer balancing 2 servers, each of which run Varnish and Nginx.
Here's the cfg file:
global
#uid 99
#gid 99
daemon
stats socket /var/run/haproxy.stat mode 600 level admin
maxconn 40000
ulimit-n 81000
pidfile /var/run/haproxy.pid
defaults
mode http
contimeout 4000
clitimeout 42000
srvtimeout 43000
balance roundrobin
listen webfarm 91.227.223.61:80
mode http
stats enable
stats auth admin:password
balance roundrobin
cookie web insert indirect nocache
option httpclose
option forwardfor
option httpchk HEAD /check.txt HTTP/1.0
server webA 91.227.223.58:80 cookie A check
server webB 91.227.221.121:80 cookie B check
option forwardfor except 91.227.223.61
reqadd X-Forwarded-Proto:\ https
reqadd FRONT_END_HTTPS:\ on
listen stats :7777
stats enable
stats uri /
option httpclose
stats auth admin:password
Problem is, this only works from localhost. If I do curl 91.227.223.61
from the local machine, the page loads fine. From any other machine, I wait several secons for the page to time out.
There does not appear to be any firewall on any of the servers (yet) and I have tried iptables -F
on each machine.
log 127.0.0.1 local0 notice
to global to try and get something out of the logs, but the log file is empty..reqadd X-Forwarded-Proto:\ https
andreqadd FRONT_END_HTTPS:\ on
are wrong as you don't use https.