Add proxy_sent_timeout and make upstream zones optional (#188)

* Add proxy_send_timeout variable

* Make zone parameter optional
This commit is contained in:
Seena Fallah 2019-11-21 15:45:18 +03:30 committed by Alessandro Fael Garcia
parent fd88f4cb22
commit 3778113cde
2 changed files with 6 additions and 0 deletions

View File

@ -357,6 +357,7 @@ nginx_http_template:
#proxy_store: off #proxy_store: off
#proxy_store_acccess: user:rw #proxy_store_acccess: user:rw
proxy_read_timeout: null proxy_read_timeout: null
proxy_send_timeout: null
proxy_ssl: proxy_ssl:
cert: /etc/ssl/certs/proxy_default.crt cert: /etc/ssl/certs/proxy_default.crt
key: /etc/ssl/private/proxy_default.key key: /etc/ssl/private/proxy_default.key

View File

@ -4,7 +4,9 @@
{% for upstream in item.value.upstreams %} {% for upstream in item.value.upstreams %}
upstream {{ item.value.upstreams[upstream].name }} { upstream {{ item.value.upstreams[upstream].name }} {
{{ item.value.upstreams[upstream].lb_method }}; {{ item.value.upstreams[upstream].lb_method }};
{% if item.value.upstreams[upstream].zone_name is defined and item.value.upstreams[upstream].zone_name %}
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 }};
{% endif %}
{% 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") }} {{ item.value.upstreams[upstream].servers[server].health_check|default("") }}; 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 %}
@ -204,6 +206,9 @@ server {
{% if item.value.reverse_proxy.locations[location].proxy_read_timeout is defined and item.value.reverse_proxy.locations[location].proxy_read_timeout %} {% if item.value.reverse_proxy.locations[location].proxy_read_timeout is defined and item.value.reverse_proxy.locations[location].proxy_read_timeout %}
proxy_read_timeout {{ item.value.reverse_proxy.locations[location].proxy_read_timeout }}; proxy_read_timeout {{ item.value.reverse_proxy.locations[location].proxy_read_timeout }};
{% endif %} {% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_send_timeout is defined and item.value.reverse_proxy.locations[location].proxy_send_timeout %}
proxy_send_timeout {{ item.value.reverse_proxy.locations[location].proxy_send_timeout }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_pass_request_body is defined %} {% if item.value.reverse_proxy.locations[location].proxy_pass_request_body is defined %}
proxy_pass_request_body {{ item.value.reverse_proxy.locations[location].proxy_pass_request_body }}; proxy_pass_request_body {{ item.value.reverse_proxy.locations[location].proxy_pass_request_body }};
{% endif %} {% endif %}