feat(streams): Add least connection and max_fails if hosts > 1
This commit is contained in:
parent
32fb98fb7c
commit
d007b5c8a4
1 changed files with 8 additions and 0 deletions
|
@ -5,8 +5,16 @@
|
||||||
{% if enabled %}
|
{% if enabled %}
|
||||||
|
|
||||||
upstream stream_{{ incoming_port }}_tcp {
|
upstream stream_{{ incoming_port }}_tcp {
|
||||||
|
{% if forwarding_hosts.length > 1 -%}
|
||||||
|
least_conn;
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
{% for forwarding_host in forwarding_hosts %}
|
{% for forwarding_host in forwarding_hosts %}
|
||||||
|
{% if forloop.first == true and forloop.last == true -%}
|
||||||
server {{ forwarding_host }}:{{ forwarding_port }};
|
server {{ forwarding_host }}:{{ forwarding_port }};
|
||||||
|
{%- else -%}
|
||||||
|
server {{ forwarding_host}}:{{ forwarding_port}} max_fails=3;
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue