<p>I'm trying to change the <code>client_max_body_size</code> value, so my NGINX ingress will not return the HTTP 413 Content Too Large error (as seen in the logs).</p>
<p>I've tested a few solutions.<br />
Here is my config map:</p>
<pre><code>kind: ConfigMap
apiVersion: v1
data:
  proxy-connect-timeout: &quot;15&quot;
  proxy-read-timeout: &quot;600&quot;
  proxy-send-timeout: &quot;600&quot;
  proxy-body-size: &quot;8m&quot;
  hsts-include-subdomains: &quot;false&quot;
  body-size: &quot;64m&quot;
  server-name-hash-bucket-size: &quot;256&quot;
  client-max-body-size: &quot;50m&quot;
metadata:
  name: nginx-configuration
  namespace: ingress-nginx
  labels:
    app: ingress-nginx
</code></pre>
<p>These changes had no effect at all: in NGINX controller's log I can see the information about reloading the config map, but the values in <code>nginx.conf</code> are the same:</p>
<pre><code>$ cat /etc/nginx/nginx.conf | grep client_max                                                                                                       
                            client_max_body_size                    &quot;8m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
                            client_max_body_size                    &quot;1m&quot;;
</code></pre>
<p>My <code>nginx-controller</code> config uses this image:
<code>quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.13.0</code></p>
<p>How can I force NGINX to change this setting? I need to change it globally, for all my ingresses.</p>

<p>You can use the <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size" rel="noreferrer">annotation</a> <code>nginx.ingress.kubernetes.io/proxy-body-size</code> to set the max-body-size option right in your Ingress object instead of changing a base ConfigMap.</p>

<p>Here is the example of usage:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-app
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "50m"
...
</code></pre>
