title: How to properly configure k8s nginx ingress base url substitution to handle Angular client side routing (LocationStrategy)?
body: <p>We have Angular based web application hosted on Kubernetes cluster.
  Ingress for this application configured to add base URL:</p>
  
  <pre><code>{
    "kind": "Ingress",
    "apiVersion": "extensions/v1beta1",
    "metadata": {
      "name": "test-app",
      "namespace": "acceptance-testing",
      ...
      "annotations": {    
        "kubernetes.io/ingress.class": "nginx",
        "nginx.ingress.kubernetes.io/add-base-url": "true",
        "nginx.ingress.kubernetes.io/rewrite-target": "/",
        "nginx.ingress.kubernetes.io/ssl-redirect": "true"
      }
    },
    "spec": {
      "rules": [
        {
          "http": {
            "paths": [
              {
                "path": "/at/test-app",
                "backend": {
                  "serviceName": "test-app",
                  "servicePort": 80
                }
              }
            ]
          }
        }
      ]
    },
    ...
  }
  </code></pre>
  
  <p>When we enter URL including client routing parts into the browser then ingress adds whole this URL as a base which is not correct in our scenario.</p>
  
  <p>For example for <em><a href="https://server/at/test-app/some-page" rel="noreferrer">https://server/at/test-app/some-page</a></em> request base URL should be <em><a href="https://server/at/test-app/" rel="noreferrer">https://server/at/test-app/</a></em> but we receiving <em><a href="https://server/at/test-app/some-page/" rel="noreferrer">https://server/at/test-app/some-page/</a></em></p>
  
  <p>We've switched to Angular hash routing location strategy and now it works properly but we want to know if there is some way to make location routing strategy works with nginx ingress?</p>
  
  <p>Thank you in advance for your help.</p>
  
  <p>Best Regards</p>