27 lines
611 B
Django/Jinja
27 lines
611 B
Django/Jinja
global
|
|
maxconn 4096
|
|
pidfile /var/run/haproxy.pid
|
|
defaults
|
|
mode tcp
|
|
timeout connect 5s
|
|
timeout client 1m
|
|
timeout server 1m
|
|
option redispatch
|
|
balance roundrobin
|
|
|
|
listen stats :1936
|
|
mode http
|
|
stats enable
|
|
stats hide-version
|
|
#stats realm Haproxy\ Statistics
|
|
stats uri /
|
|
#stats auth Username:Password
|
|
|
|
{% for service in services %}
|
|
listen {{ service.service_name }}
|
|
bind {{service.bind}}
|
|
{% for backend in service.backends %}
|
|
server {{ backend.remote_name }} {{ backend.remote_addr }} check inter 2s rise 3 fall 2
|
|
{% endfor %}
|
|
{% endfor %}
|