[Bug]: client-max-body-size on (upstream) VirtualServer is never considered #7332
Labels
backlog
Pull requests/issues that are backlog items
bug
An issue reporting a potential bug
ready for refinement
An issue that was triaged and it is ready to be refined
Version
edge
What Kubernetes platforms are you running on?
Other
Steps to reproduce
Bug
When applying the
client-max-body-size
option on the upstream, via VirtualServer it ultimately has no effect. This is not say that it's not applied to the conf because it is, this is more to say that it doesn't work - this seems to be that the client max body size is then set on the sub location resource and not the originally matching location.This may be either intended behaviour or a bug, but since it's nginx that's interpreting that conf, that would be a bug in nginx, however I think there would be ways to workaround this in the operator.
Reproduction and testing
I've included some examples here but, they're really to show what's going on more than to be things you can just take and run (as the upstream itself is not provided).
Once this is deployed, this becomes the following nginx conf; (this is a snippet as the actual conf is quite a bit longer but the important parts are included);
In the above example, we can see that our
client_max_body_size 15m;
was added tolocation /internal_location_matches_0_match_0 {
as that's the match that proxies to our upstream. However, the default of 1m is still used so we're unable to send anything larger still.If we modify this slightly to change the originally matching location block;
And add the max body size here;
And we copy this into nginx;
We're now able to send bodies that are larger than 1m and upto our defined 15m.
I have no doubts that sever and http snippets would also fix this but, this would then apply to all defined endpoints and upstreams within that scope which may not be what we want.
Possible Solutions
s.InternalRedirectLocations
struct or if the option is within the loop of another struct that could be used, the template for this here;kubernetes-ingress/internal/configs/version2/nginx.virtualserver.tmpl
Line 190 in 278f841
Related issues
#5859
#5317
The text was updated successfully, but these errors were encountered: