Convert isValidClientBodyBufferSize to something more generic and use it for client_max_body_size

This commit is contained in:
Maxime Ginters 2018-11-09 09:45:11 -05:00
parent 023261142c
commit 0f3e2b9bf0
3 changed files with 20 additions and 15 deletions

View file

@ -874,8 +874,10 @@ stream {
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_pass_request_headers on;
{{ if isValidByteSize $location.Proxy.BodySize }}
client_max_body_size {{ $location.Proxy.BodySize }};
{{ if isValidClientBodyBufferSize $location.ClientBodyBufferSize }}
{{ end }}
{{ if isValidByteSize $location.ClientBodyBufferSize }}
client_body_buffer_size {{ $location.ClientBodyBufferSize }};
{{ end }}
@ -1084,8 +1086,10 @@ stream {
}
{{ end }}
{{ if isValidByteSize $location.Proxy.BodySize }}
client_max_body_size {{ $location.Proxy.BodySize }};
{{ if isValidClientBodyBufferSize $location.ClientBodyBufferSize }}
{{ end }}
{{ if isValidByteSize $location.ClientBodyBufferSize }}
client_body_buffer_size {{ $location.ClientBodyBufferSize }};
{{ end }}