title: When I would use the "App Root" annotation in Kubernetes
body: <p>I've read the docs a thousand times but I still don't understand how I would use the <code>nginx.ingress.kubernetes.io/app-root</code> annotation.</p>
  <p>Can someone please provide an example + description in plain english?</p>
  <p>Docs: <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/examples/rewrite/</a></p>
  <p>I might as well copy paste the entire text; it's not that much.</p>
  <blockquote>
  <p>nginx.ingress.kubernetes.io/app-root  Defines the Application Root that
  the Controller must redirect if it's in '/' context   string</p>
  </blockquote>
  <p><strong>App Root</strong></p>
  <p>Create an Ingress rule with a app-root annotation:</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    annotations:
      nginx.ingress.kubernetes.io/app-root: /app1
    name: approot
    namespace: default
  spec:
    rules:
    - host: approot.bar.com
      http:
        paths:
        - backend:
            serviceName: http-svc
            servicePort: 80
          path: /
  </code></pre>
  <p>Check the rewrite is working</p>
  <pre><code>$ curl -I -k http://approot.bar.com/
  HTTP/1.1 302 Moved Temporarily
  Server: nginx/1.11.10
  Date: Mon, 13 Mar 2017 14:57:15 GMT
  Content-Type: text/html
  Content-Length: 162
  Location: http://stickyingress.example.com/app1
  Connection: keep-alive
  </code></pre>