Allow to set proxy_connect_timeout and proxy_read_timeout per reverse proxy

This commit is contained in:
Marcin Mielnicki 2019-03-07 21:34:22 +01:00
parent 1d30d42c68
commit d2a6f4b81e
No known key found for this signature in database
GPG Key ID: D9F664AB9ECDCA12
3 changed files with 10 additions and 0 deletions

View File

@ -365,7 +365,9 @@ nginx_http_template:
locations: locations:
backend: backend:
location: / location: /
proxy_connect_timeout: 300
proxy_pass: http://backend proxy_pass: http://backend
proxy_read_timeout: 300
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

@ -207,7 +207,9 @@ nginx_http_template:
locations: locations:
backend: backend:
location: / location: /
proxy_connect_timeout: null
proxy_pass: http://backend proxy_pass: http://backend
proxy_read_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

@ -85,8 +85,14 @@ server {
{% endif %} {% endif %}
{% if item.value.reverse_proxy.locations[location].auth_basic_file is defined and item.value.reverse_proxy.locations[location].auth_basic_file %} {% if item.value.reverse_proxy.locations[location].auth_basic_file is defined and item.value.reverse_proxy.locations[location].auth_basic_file %}
auth_basic_user_file {{ item.value.reverse_proxy.locations[location].auth_basic_file }}; auth_basic_user_file {{ item.value.reverse_proxy.locations[location].auth_basic_file }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_connect_timeout is defined and item.value.reverse_proxy.locations[location].proxy_connect_timeout %}
proxy_connect_timeout {{ item.value.reverse_proxy.locations[location].proxy_connect_timeout }};
{% endif %} {% endif %}
proxy_pass {{ item.value.reverse_proxy.locations[location].proxy_pass }}; proxy_pass {{ item.value.reverse_proxy.locations[location].proxy_pass }};
{% 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 }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_ssl is defined %} {% if item.value.reverse_proxy.locations[location].proxy_ssl is defined %}
{% if item.value.reverse_proxy.locations[location].proxy_ssl.cert is defined %} {% if item.value.reverse_proxy.locations[location].proxy_ssl.cert is defined %}