Support dynamic client_max_body_size and new response_max_body_size

Jussi Maki jusmaki at gmail.com
Thu Jun 17 19:44:47 UTC 2021


Hi,
have there been plans on adding support for dynamic client_max_body_size,
based on nginx-variable so it could be set for example in Lua-code per
request?
Also another nice feature to support dynamic size limitations would be a
response size body limit like response_max_body_size with support for
dynamic limits using a variable?

If this is not planned for any near future I could try to see how
challenging this kind of support would be to add. I guess for the
client_max_body_size variable resolution would be reasonably simple
following example from some other existing dynamic variables.

However, adding support for response_max_body_size would require a bit more
changes and also in the case of chunked-encoding a good question would be
what should be done if the content-size limit exceeds during the response,
should the connection be closed or what. Or perhaps this kind of
feature would only be supported for responses with Content-Length header?

Alternatively these limitations could be done by perhaps using some Lua
code and ngx.location.capture but I think it would be cleaner to have a
dynamic control variable for the limits.

br,
Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20210617/24fc0d81/attachment.htm>


More information about the nginx-devel mailing list