Support 'client_max_body_size' (server, location) (#157)

* Support 'client_max_body_size' (server, location)

* Added 'client_max_body_size' to default/main.yml
This commit is contained in:
Zeno Grandi 2019-07-15 20:42:15 +02:00 committed by Alessandro Fael Garcia
parent b1ee7e7ff2
commit 1724fecdd8
3 changed files with 10 additions and 0 deletions

View File

@ -371,6 +371,7 @@ nginx_http_template:
#auth_request_set:
#name: $auth_user
#value: $upstream_http_x_user
client_max_body_size: 1m
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
add_headers:
strict_transport_security:
@ -418,6 +419,7 @@ nginx_http_template:
#auth_request_set:
#name: $auth_user
#value: $upstream_http_x_user
client_max_body_size: 1m
#returns:
#return302:
#code: 302

View File

@ -183,6 +183,7 @@ nginx_http_template:
#auth_request_set:
#name: $auth_user
#value: $upstream_http_x_user
client_max_body_size: 1m
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
add_headers:
strict_transport_security:
@ -230,6 +231,7 @@ nginx_http_template:
#auth_request_set:
#name: $auth_user
#value: $upstream_http_x_user
client_max_body_size: 1m
#returns:
#return302:
#code: 302

View File

@ -125,6 +125,9 @@ server {
{% if item.value.auth_request_set is defined %}
auth_request_set {{ item.value.auth_request_set.name }} {{ item.value.auth_request_set.value }};
{% endif %}
{% if item.value.client_max_body_size is defined and item.value.client_max_body_size %}
client_max_body_size {{ item.value.client_max_body_size }};
{% endif %}
{% if item.value.reverse_proxy is defined and item.value.reverse_proxy %}
{% for location in item.value.reverse_proxy.locations %}
@ -254,6 +257,9 @@ server {
{% if item.value.reverse_proxy.locations[location].proxy_ignore_headers is defined %}
proxy_ignore_headers {{ item.value.reverse_proxy.locations[location].proxy_ignore_headers | join(" ") }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].client_max_body_size is defined and item.value.reverse_proxy.locations[location].client_max_body_size %}
client_max_body_size {{ item.value.reverse_proxy.locations[location].client_max_body_size }};
{% endif %}
{% if item.value.reverse_proxy.locations[location].proxy_cookie_path is defined %}
proxy_cookie_path {{ item.value.reverse_proxy.locations[location].proxy_cookie_path.path }} {{ item.value.reverse_proxy.locations[location].proxy_cookie_path.replacement }};
{% endif %}