Skip to content

Commit bd25c22

Browse files
authored
Merge pull request #60 from magenbrot/haproxy-backend
Haproxy backend template
2 parents d554e34 + 0f1b466 commit bd25c22

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ haproxy_frontend:
209209
haproxy_backend:
210210
- dashboard_backend:
211211
balance: source
212+
default_server: "inter 2s downinter 5s rise 3 fall 2 slowstart 30s maxconn 30 maxqueue 64 weight 100"
213+
http_checks:
214+
- 'send meth GET uri /check-haproxy.php hdr Host haproxy.check-vhost.de'
215+
- 'expect string "All services running fine"'
212216
bind_process:
213217
- 1
214218
server_templates:

templates/etc/haproxy/haproxy-backend.cfg.j2

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
backend {{ name }}
88
{% if value.mode is defined %}
99
mode {{ value.mode }}
10+
{% endif %}
11+
{% if value.default_server is defined %}
12+
default-server {{ value.default_server }}
1013
{% endif %}
1114
{% if value.description is defined %}
1215
description {{ value.description }}
@@ -17,9 +20,10 @@ backend {{ name }}
1720
{% if value.hash_type is defined %}
1821
hash-type {{ value.hash_type }}
1922
{% endif %}
20-
{% if value.http_check is defined %}
21-
http-check {{ value.http_check }}
22-
{% endif %}
23+
{% if value.http_checks is defined %}
24+
{% for http_check in value.http_checks %}
25+
http-check {{ http_check }}
26+
{% endfor %}
2327
{% if value.cookie is defined %}
2428
cookie {{ value.cookie }}
2529
{% endif %}

0 commit comments

Comments
 (0)