Merge pull request #70 from 0x28d/master

Allow setting a passive health checks
This commit is contained in:
Alessandro Fael Garcia 2018-11-12 10:30:30 -08:00 committed by GitHub
commit 63126c3ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -182,6 +182,7 @@ nginx_http_template:
address: localhost address: localhost
port: 8081 port: 8081
weight: 1 weight: 1
health_check: max_fails=1 fail_timeout=10s
# Enable creating dynamic templated NGINX stream configuration files. # Enable creating dynamic templated NGINX stream configuration files.
nginx_stream_template_enable: false nginx_stream_template_enable: false

View File

@ -4,12 +4,13 @@ upstream {{ item.value.upstreams[upstream].name }} {
{{ item.value.upstreams[upstream].lb_method }}; {{ item.value.upstreams[upstream].lb_method }};
zone {{ item.value.upstreams[upstream].zone_name }} {{ item.value.upstreams[upstream].zone_size }}; zone {{ item.value.upstreams[upstream].zone_name }} {{ item.value.upstreams[upstream].zone_size }};
{% for server in item.value.upstreams[upstream].servers %} {% for server in item.value.upstreams[upstream].servers %}
server {{ item.value.upstreams[upstream].servers[server].address }}:{{ item.value.upstreams[upstream].servers[server].port }} weight={{ item.value.upstreams[upstream].servers[server].weight|default("1") }}; server {{ item.value.upstreams[upstream].servers[server].address }}:{{ item.value.upstreams[upstream].servers[server].port }} weight={{ item.value.upstreams[upstream].servers[server].weight|default("1") }} {{ item.value.upstreams[upstream].servers[server].health_check|default("") }};
{% endfor %} {% endfor %}
{% if item.value.upstreams[upstream].sticky_cookie %} {% if item.value.upstreams[upstream].sticky_cookie %}
sticky cookie srv_id expires=1h path=/; sticky cookie srv_id expires=1h path=/;
{% endif %} {% endif %}
} }
{% endfor %} {% endfor %}
{% endif %} {% endif %}