Merge pull request #110 from platan/proxy_timeouts

Allow to set proxy_connect_timeout and proxy_read_timeout per reverse proxy
This commit is contained in:
Grzegorz Dzien 2019-03-19 12:19:15 +00:00 committed by GitHub
commit a68ddd708d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: 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

@ -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 %}