Add ability to rewrite proxy pass locations (#161)

This commit is contained in:
Stanislav Mekhonoshin 2019-07-27 00:21:34 +03:00 committed by Alessandro Fael Garcia
parent a8b7fff7fc
commit 5416fb28e0
3 changed files with 5 additions and 0 deletions

View File

@ -463,6 +463,7 @@ nginx_http_template:
#always: false
proxy_connect_timeout: null
proxy_pass: http://backend
#rewrite: /foo(.*) /$1 break
#proxy_pass_request_body: off
proxy_set_header:
header_host:

View File

@ -275,6 +275,7 @@ nginx_http_template:
#always: false
proxy_connect_timeout: null
proxy_pass: http://backend
#rewrite: /foo(.*) /$1 break
#proxy_pass_request_body: off
proxy_set_header:
header_host:

View File

@ -180,6 +180,9 @@ server {
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].rewrite is defined %}
rewrite {{ item.value.reverse_proxy.locations[location].rewrite }};
{% endif %}
{% 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 %}