2025-02-07 14:53:09 +01:00
|
|
|
{% 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,) }}
|
|
|
|
{% endblock frontend %}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Backend section
|
|
|
|
#
|
|
|
|
|
|
|
|
{% block backend %}
|
|
|
|
{{ output_backends(backends,
|
|
|
|
config=[
|
2025-02-10 11:29:57 +01:00
|
|
|
'option httpchk'
|
2025-02-07 14:53:09 +01:00
|
|
|
'http-check expect status 200',
|
2025-02-07 15:41:27 +01:00
|
|
|
'default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions',
|
2025-02-07 14:53:09 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
{% endblock backend %}
|