title: Kubernetes NGINX Ingress: Disable Basic Auth for specific path
body: <p>I want to disable basic auth only on a specific subpath of my App. How this can be done?</p>
  
  <p>e.g.</p>
  
  <p><strong>All subpaths should be basic auth secured:</strong></p>
  
  <pre><code>/ 
  </code></pre>
  
  <p><strong>This path should be an exception and public reachable:</strong></p>
  
  <pre><code>/#/public 
  </code></pre>
  
  <p>ingress.yaml</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: app
    labels:
      app: app
    annotations:
      kubernetes.io/ingress.class: nginx
      kubernetes.io/tls-acme: "true"
      ingress.kubernetes.io/auth-type: basic
      ingress.kubernetes.io/auth-secret: basic-auth
      ingress.kubernetes.io/auth-realm:  "Authentication Required"
  spec:
    rules:
    - host: "&lt;MYHOST&gt;"
      http:
        paths:
        - path: /
          backend:
            serviceName: app-service
            servicePort: 80
    tls:
      - secretName: "app-secret"
        hosts:
        - "&lt;MYHOST&gt;"
  </code></pre>