Ingress-nginx: 413 request entity too large

Created on 11 Dec 2019  路  8Comments  路  Source: kubernetes/ingress-nginx

Is this a request for help? yes

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):

413 request entity too large

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug

I am trying to increase the max post size with the ingress controller. We are using the mandatory.yaml from this repo. When I attempt to add the following, it has no affect. Can someone please explain how to make this change? I want to apply this globally in the ingress controller.

kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-configuration
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 10m

If this is a FEATURE REQUEST, please:

  • Describe in detail the feature/behavior/change you'd like to see.

NGINX Ingress controller version:

Image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1

Kubernetes version (use kubectl version):

ags:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Most helpful comment

Adding the annotation worked just fine for me:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-app-name
  namespace: my-namespace
  annotations:
    kubernetes.io/ingress.class: "nginx"
    [...]
    nginx.ingress.kubernetes.io/proxy-body-size: 16m

All 8 comments

@aledbf It doesn't work. I have already looked at this. I am asking for support on figuring out why it isn't working.

I want to apply this globally in the ingress controller.

If you want to change this globally you need to modify the configuration configmap https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#proxy-body-size

Once you change that you can verify the new value using something like
kubectl exec -n ingress-nginx <ingress pod> cat nginx.conf|grep client_max_body_size

@aledbf in my original text above, do I have this applied in the correct location? When I then issue kubectl apply -f mandatory.yaml, it doesn't seem to redeploy in my cluster.

in my original text above, do I have this applied in the correct location?

No. Annotations are valid in Ingress objects.

You should have something like:

kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-configuration
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
data:
  proxy-body-size: 10m

@aledbf Ok, this now works. We need to update the documentation on this subject, because it is not clear exactly the correct global configuration like you gave me above. A good example would be useful.

@rwmajor2 can you be more explicit? What do you want to see in the docs?

Pull requests are welcome :)

Adding the annotation worked just fine for me:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-app-name
  namespace: my-namespace
  annotations:
    kubernetes.io/ingress.class: "nginx"
    [...]
    nginx.ingress.kubernetes.io/proxy-body-size: 16m
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sophaskins picture sophaskins  路  3Comments

geek876 picture geek876  路  3Comments

lachlancooper picture lachlancooper  路  3Comments

yuyang0 picture yuyang0  路  3Comments

smeruelo picture smeruelo  路  3Comments