<p>I am fairly new to GCP and I have a rest URI to upload large files.<br />
I have a ngress-nginx-controller service and want to change it to upload files larger than 1mb and set a limit.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {&quot;apiVersion&quot;:&quot;v1&quot;,&quot;kind&quot;:&quot;Service&quot;,&quot;metadata&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{&quot;app.kubernetes.io/component&quot;:&quot;controller&quot;,&quot;app.kubernetes.io/instance&quot;:&quot;ingress-nginx&quot;,&quot;app.kubernetes.io/managed-by&quot;:&quot;Helm&quot;,&quot;app.kubernetes.io/name&quot;:&quot;ingress-nginx&quot;,&quot;app.kubernetes.io/version&quot;:&quot;0.35.0&quot;,&quot;helm.sh/chart&quot;:&quot;ingress-nginx-2.13.0&quot;},&quot;name&quot;:&quot;ingress-nginx-controller&quot;,&quot;namespace&quot;:&quot;ingress-nginx&quot;},&quot;spec&quot;:{&quot;externalTrafficPolicy&quot;:&quot;Local&quot;,&quot;ports&quot;:[{&quot;name&quot;:&quot;http&quot;,&quot;port&quot;:80,&quot;protocol&quot;:&quot;TCP&quot;,&quot;targetPort&quot;:&quot;http&quot;},{&quot;name&quot;:&quot;https&quot;,&quot;port&quot;:443,&quot;protocol&quot;:&quot;TCP&quot;,&quot;targetPort&quot;:&quot;https&quot;}],&quot;selector&quot;:{&quot;app.kubernetes.io/component&quot;:&quot;controller&quot;,&quot;app.kubernetes.io/instance&quot;:&quot;ingress-nginx&quot;,&quot;app.kubernetes.io/name&quot;:&quot;ingress-nginx&quot;},&quot;type&quot;:&quot;LoadBalancer&quot;}}
  creationTimestamp: &quot;2020-09-21T18:37:27Z&quot;
  finalizers:
  - service.kubernetes.io/load-balancer-cleanup
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/version: 0.35.0
    helm.sh/chart: ingress-nginx-2.13.0
  name: ingress-nginx-controller
  namespace: ingress-nginx
</code></pre>
<p>This is the error it throws :</p>
<pre><code>&lt;html&gt;
&lt;head&gt;&lt;title&gt;413 Request Entity Too Large&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;&lt;h1&gt;413 Request Entity Too Large&lt;/h1&gt;&lt;/center&gt;
&lt;hr&gt;&lt;center&gt;nginx/1.19.2&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

Jainam Shah
<p>If you need to increase the body size of files you upload via the ingress controller, you need to add an annotation to your ingress resource:</p>
<pre><code>nginx.ingress.kubernetes.io/proxy-body-size: 8m
</code></pre>
<p>Documentation available here: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size</a></p>
