Max file upload issue with Rancher Nginx Load Balancer

I’m using Rancher 2.0.2 setup with a Load Balancer to perform SSL termination/reverse proxying. Functionally it seems to work until I try to upload a large file (~13MB) to a Flask webserver being hosted in a container behind the ingress controller.

The error I get after ~20 seconds of trying to upload the file is:
413 Request Entity Too Large
nginx/1.13.8

From looking through the docs and forums, this error looks to be caused by the default nginx setting for client_max_body_size being set to 1M. On a normal nginx setup, I could just go update /etc/nginx/nginx.conf and add/update this parameter. How can I do this for the Rancher 2.0 load balancer ingress controller?

For reference, I have this same workload image running the Flask webserver behind a Rancher 2.0.0-alpha9 deployment (it might use ha proxy for load balancing and ssl termination instead?) and do not see this issue.

Thanks

1 Like

Check this:

http://forums.rancher.com/t/ingress-client-max-body-size

Thanks, are there any examples/instructions on how to apply a config map through Rancher?

I created this ConfigMap file:

kind: ConfigMap
apiVersion: v1
metadata:
name: default/nginx-configuration
data:
nginx.ingress.kubernetes.io/client-max-body-size: “200m”
nginx.ingress.kubernetes.io/proxy-body-size: “200m”

And went to the Workloads > Load Balancing > Import YAML. It would not accept the Config map until I removed the '/'s. So I ended up importing the following which was accepted:

kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration
data:
client-max-body-size: “200m”
proxy-body-size: “200m”

However, this did not seem to have any effect when I tried to re-upload the large file. Any guidance?

Thanks!