Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

413 request entity too large #4825

Closed
rwmajor2 opened this issue Dec 11, 2019 · 9 comments
Closed

413 request entity too large #4825

rwmajor2 opened this issue Dec 11, 2019 · 9 comments

Comments

@rwmajor2
Copy link

rwmajor2 commented Dec 11, 2019

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:

@aledbf
Copy link
Member

aledbf commented Dec 11, 2019

Closing. Please check https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size

@aledbf aledbf closed this as completed Dec 11, 2019
@rwmajor2
Copy link
Author

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

@aledbf
Copy link
Member

aledbf commented Dec 11, 2019

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

@rwmajor2
Copy link
Author

rwmajor2 commented Dec 11, 2019

@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.

@aledbf
Copy link
Member

aledbf commented Dec 11, 2019

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

@rwmajor2
Copy link
Author

@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.

@aledbf
Copy link
Member

aledbf commented Dec 11, 2019

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

Pull requests are welcome :)

@gsusI
Copy link

gsusI commented Nov 4, 2020

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

@villesau
Copy link

How can this be applied on per route basis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants