63 lines
1.2 KiB
Text
63 lines
1.2 KiB
Text
|
{% extends 'common/haproxy_base.j2' %}
|
||
|
|
||
|
{% from "common/haproxy_macros.j2" import bind_ip_tcp, output_backends %}
|
||
|
|
||
|
{% block defaults %}
|
||
|
defaults
|
||
|
log global
|
||
|
mode tcp
|
||
|
retries 2
|
||
|
option dontlognull
|
||
|
timeout client 30m
|
||
|
timeout connect 4s
|
||
|
timeout server 30m
|
||
|
timeout check 5s
|
||
|
{% endblock defaults %}
|
||
|
|
||
|
{% block stats %}
|
||
|
frontend LB-http
|
||
|
# expose stats info over HTTP to exabgp
|
||
|
bind 127.0.0.1:9000
|
||
|
http-request set-log-level silent
|
||
|
default_backend LB
|
||
|
|
||
|
backend LB
|
||
|
stats enable
|
||
|
#stats hide-version
|
||
|
stats uri /haproxy_stats
|
||
|
{% endblock stats %}
|
||
|
|
||
|
|
||
|
{% block global_backends %}
|
||
|
{% endblock global_backends %}
|
||
|
|
||
|
|
||
|
{% block https_everything %}
|
||
|
{% endblock https_everything %}
|
||
|
|
||
|
#
|
||
|
# Frontend section
|
||
|
#
|
||
|
|
||
|
{% block frontend %}
|
||
|
frontend {{ site_name }}
|
||
|
{{ bind_ip_tcp(bind_ips, 5000,) }}
|
||
|
option httpchk
|
||
|
http-check expect status 200
|
||
|
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
|
||
|
{% endblock frontend %}
|
||
|
|
||
|
#
|
||
|
# Backend section
|
||
|
#
|
||
|
|
||
|
{% block backend %}
|
||
|
{{ output_backends(backends,
|
||
|
config=[
|
||
|
'option httpchk GET',
|
||
|
'http-check expect status 200',
|
||
|
],
|
||
|
)
|
||
|
}}
|
||
|
{% endblock backend %}
|