Friedrich Ewald My Personal Website

413 Request Entity Too Large in nginx k8s ingress

I wanted to enable a file upload. Whenever I was uploading I received the error code “413 Request Entity Too Large” from the nginx ingress controller in kubernetes. I found the solution here. Use the following annotation to allow unlimited upload size:

nginx.ingress.kubernetes.io/proxy-body-size: "0"
In my case, the ingress file definition now looks like this:
---
apiVersion: networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
kind: Ingress
metadata:
  name: my-name
  namespace: my-namespace
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
  # The specs, omitted for readability


About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.