<p>We are migrating from a traditional nginx deployment to a kubernetes nginx-ingress controller. I'm trying to apply settings at a <code>location</code> level, but can't see how to do so with annotations.</p>

<p>For example, we had:</p>

<pre><code>server {
  listen 80;
  server_name example.com;

  location /allow-big-uploads {
    client_max_body_size 100M;
    ...
  }
}
</code></pre>

<p>And we translate to something like this:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: web-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 100m &lt;-- this now applies globally
spec:
  rules:
    - host: example.com
      http:
        paths:
          - path: /allow-big-uploads
            backend:
              serviceName: example-svc
              servicePort: 5009
</code></pre>

<p>Adding that annotation under the <code>path</code> section doesn't seem to work. Am I missing something?</p>

<p>If you have 2 locations on the same host and you want to apply a setting on just one location , you can create 2 ingresses with the same hosts , and apply on the ingress you are interested the configuration snippet annotation:</p>

<p><a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet</a></p>

<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |

  more_set_headers "Request-Id: $req_id";
</code></pre>

<p>i have tried for this example and it works. </p>

<p>However, when i try to change the <strong>client_max_body_size</strong> via the configuration snippet , i get the error :</p>

<pre><code>"client_max_body_size" directive is duplicate
</code></pre>
