Skip to content

Commit a68ddd7

Browse files
authored
Merge pull request #110 from platan/proxy_timeouts
Allow to set proxy_connect_timeout and proxy_read_timeout per reverse proxy
2 parents 1d30d42 + 8264944 commit a68ddd7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ nginx_http_template:
365365
locations:
366366
backend:
367367
location: /
368+
proxy_connect_timeout: null
368369
proxy_pass: http://backend
370+
proxy_read_timeout: null
369371
proxy_ssl:
370372
cert: /etc/ssl/certs/proxy_default.crt
371373
key: /etc/ssl/private/proxy_default.key

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ nginx_http_template:
207207
locations:
208208
backend:
209209
location: /
210+
proxy_connect_timeout: null
210211
proxy_pass: http://backend
212+
proxy_read_timeout: null
211213
proxy_ssl:
212214
cert: /etc/ssl/certs/proxy_default.crt
213215
key: /etc/ssl/private/proxy_default.key

templates/http/default.conf.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,14 @@ server {
8585
{% endif %}
8686
{% if item.value.reverse_proxy.locations[location].auth_basic_file is defined and item.value.reverse_proxy.locations[location].auth_basic_file %}
8787
auth_basic_user_file {{ item.value.reverse_proxy.locations[location].auth_basic_file }};
88+
{% endif %}
89+
{% if item.value.reverse_proxy.locations[location].proxy_connect_timeout is defined and item.value.reverse_proxy.locations[location].proxy_connect_timeout %}
90+
proxy_connect_timeout {{ item.value.reverse_proxy.locations[location].proxy_connect_timeout }};
8891
{% endif %}
8992
proxy_pass {{ item.value.reverse_proxy.locations[location].proxy_pass }};
93+
{% if item.value.reverse_proxy.locations[location].proxy_read_timeout is defined and item.value.reverse_proxy.locations[location].proxy_read_timeout %}
94+
proxy_read_timeout {{ item.value.reverse_proxy.locations[location].proxy_read_timeout }};
95+
{% endif %}
9096
{% if item.value.reverse_proxy.locations[location].proxy_ssl is defined %}
9197

9298
{% if item.value.reverse_proxy.locations[location].proxy_ssl.cert is defined %}

0 commit comments

Comments
 (0)