diff --git a/README.md b/README.md index 782fca6..170b51a 100644 --- a/README.md +++ b/README.md @@ -365,7 +365,9 @@ nginx_http_template: locations: backend: location: / + proxy_connect_timeout: null proxy_pass: http://backend + proxy_read_timeout: null proxy_ssl: cert: /etc/ssl/certs/proxy_default.crt key: /etc/ssl/private/proxy_default.key diff --git a/defaults/main.yml b/defaults/main.yml index 919e29f..60f5b1b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -207,7 +207,9 @@ nginx_http_template: locations: backend: location: / + proxy_connect_timeout: null proxy_pass: http://backend + proxy_read_timeout: null proxy_ssl: cert: /etc/ssl/certs/proxy_default.crt key: /etc/ssl/private/proxy_default.key diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index 8c3c9c0..45a9cb2 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -85,8 +85,14 @@ server { {% endif %} {% 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 }}; +{% 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 %} 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.cert is defined %}