diff --git a/README.md b/README.md index 15d7f62..43c1954 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index 1cd312b..686fcb8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index 3437c44..ff32f40 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -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 %}