Added option to set allows and denies for locations (#133)

This commit is contained in:
Carl Bäckström 2019-08-05 20:20:12 +02:00 committed by Alessandro Fael Garcia
parent 487a2d0c07
commit b2fc8b5621
3 changed files with 18 additions and 0 deletions

View File

@ -469,6 +469,10 @@ nginx_http_template:
proxy_pass: http://backend
#rewrite: /foo(.*) /$1 break
#proxy_pass_request_body: off
#allows:
# - 192.168.1.0/24
#denies:
# - all
proxy_set_header:
header_host:
name: Host

View File

@ -281,6 +281,10 @@ nginx_http_template:
proxy_pass: http://backend
#rewrite: /foo(.*) /$1 break
#proxy_pass_request_body: off
#allows:
# - 192.168.1.0/24
#denies:
# - all
proxy_set_header:
header_host:
name: Host

View File

@ -195,6 +195,16 @@ server {
{% if item.value.reverse_proxy.locations[location].proxy_store_access is defined %}
proxy_store_access {{ item.value.reverse_proxy.locations[location].proxy_store_access }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].allows is defined %}
{% for allow in item.value.reverse_proxy.locations[location].allows %}
allow {{ allow }};
{% endfor %}
{% endif %}
{% if item.value.reverse_proxy.locations[location].denies is defined %}
{% for deny in item.value.reverse_proxy.locations[location].denies %}
deny {{ deny }};
{% endfor %}
{% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_set_header is defined %}
{% for header in item.value.reverse_proxy.locations[location].proxy_set_header %}
proxy_set_header {{ item.value.reverse_proxy.locations[location].proxy_set_header[header].name }} {{ item.value.reverse_proxy.locations[location].proxy_set_header[header].value }};