1
0
Fork 0

Add ssl-check

This commit is contained in:
Joao Gilberto Magalhaes 2023-02-26 20:56:32 -06:00
parent 173a31ea80
commit 6e367174d4
7 changed files with 35 additions and 17 deletions

View file

@ -59,7 +59,7 @@ frontend {{ mode }}_in_{{ o["port"] }}
{% for k in o["hosts"] -%}
{% set host = k.replace(".", "_") + "_{0}".format(o["port"]) %}
backend srv_{{ host }}
balance roundrobin
balance {{ o["balance"] | default("roundrobin") }}
mode {{ mode }}
{% if mode == "http" %}
option forwardfor
@ -67,10 +67,10 @@ backend srv_{{ host }}
http-request add-header X-Forwarded-Proto https if { ssl_fc }
{% elif mode == "tcp" %}
option tcp-check
tcp-check connect{{ " ssl" if o["health-check"] == "ssl" }}
tcp-check connect{{ " ssl" if o["ssl-check"] == "ssl" }}
{% endif %}
{% for c in o["hosts"][k]["containers"] %}
server srv-{{ loop.index0 }} {{ c }} check weight 1{{ " verify none" if o["health-check"] == "ssl" }}
server srv-{{ loop.index0 }} {{ c }} check weight 1{{ " verify none" if o["ssl-check"] == "ssl" }}
{% endfor %}
{% endfor %}
{% endfor %}