413 error with Kubernetes and Nginx ingress controller
You can use the annotation nginx.ingress.kubernetes.io/proxy-body-size
to set the max-body-size option right in your Ingress object instead of changing a base ConfigMap.
Here is the example of usage:
apiVersion: extensions/v1beta1kind: Ingressmetadata: name: my-app annotations: nginx.ingress.kubernetes.io/proxy-body-size: "50m"...
To set it globally, this configmap.md documentation might be helpful. Turns out the variable to set is proxy-body-size
, not client-max-body-size
.
When you deploy the helm chart, you can set --set-string controller.config.proxy-body-size="4m"
.
Update:
I have been experiencing the same problem and no solutions were working. After reading through countless blogs and docs that all had the same suggested solution I found that they have changed the naming convention.
It is no longer denoted by "proxy-body-size" or this just never works for me.
link below shows that the correct configmap variable to use is "client-max-body-size"