Skip to content

Commit

Permalink
Merge pull request #60 from magenbrot/haproxy-backend
Browse files Browse the repository at this point in the history
Haproxy backend template
  • Loading branch information
goldyfruit authored Jun 8, 2022
2 parents d554e34 + 0f1b466 commit bd25c22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ haproxy_frontend:
haproxy_backend:
- dashboard_backend:
balance: source
default_server: "inter 2s downinter 5s rise 3 fall 2 slowstart 30s maxconn 30 maxqueue 64 weight 100"
http_checks:
- 'send meth GET uri /check-haproxy.php hdr Host haproxy.check-vhost.de'
- 'expect string "All services running fine"'
bind_process:
- 1
server_templates:
Expand Down
10 changes: 7 additions & 3 deletions templates/etc/haproxy/haproxy-backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
backend {{ name }}
{% if value.mode is defined %}
mode {{ value.mode }}
{% endif %}
{% if value.default_server is defined %}
default-server {{ value.default_server }}
{% endif %}
{% if value.description is defined %}
description {{ value.description }}
Expand All @@ -17,9 +20,10 @@ backend {{ name }}
{% if value.hash_type is defined %}
hash-type {{ value.hash_type }}
{% endif %}
{% if value.http_check is defined %}
http-check {{ value.http_check }}
{% endif %}
{% if value.http_checks is defined %}
{% for http_check in value.http_checks %}
http-check {{ http_check }}
{% endfor %}
{% if value.cookie is defined %}
cookie {{ value.cookie }}
{% endif %}
Expand Down

0 comments on commit bd25c22

Please sign in to comment.