system-config/playbooks/roles/haproxy/templates/haproxy.cfg.j2
Clark Boylan 08a113d4a8 Actually check backends are alive in haproxy
This adds the simplest form of health checking to haproxy, a tcp check
to the backends. We can do more sophisticated checks like checking ssl
negotiates or even HTTP requests but for now this is probably a good
improvement.

Change-Id: I3c6b07df4b3e0c380c757e1e5cb51ae0be655f34
2019-07-23 08:13:12 -07:00

37 lines
734 B
Django/Jinja

global
uid 1000
gid 1000
log /dev/log local0
maxconn 4000
pidfile /var/haproxy/run/haproxy.pid
stats socket /var/haproxy/run/stats uid 1000 gid 1000 mode 0600 level admin
defaults
log global
maxconn 8000
option redispatch
retries 3
stats enable
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 2m
timeout server 2m
timeout check 10s
{% for listener in haproxy_listeners %}
listen {{ listener.name }}
{% for bind in listener.bind %}
bind {{ bind }}
{% endfor %}
mode tcp
balance source
option tcplog
option tcp-check
{% for server in listener.servers %}
server {{ server.name }} {{ server.address }} check
{% endfor %}
{% endfor %}