title: Add conditional request header in ingress controller according to incoming calls
body: <p>I am adding the external authentication using auth-url annotation. How to set conditional request headers for the auth-url api which depends on incoming calls? Can I set the request headers in nginx controller according to incoming calls?</p>
  <p>Edited:</p>
  <p>Hi,
  This is about adding a custom header(Id) which is expected into auth-url. I am setting the Id header which is required in authorize api of auth-url but not receiving in the api. Is this the right method to set? My next question is If it is set how can I set it conditionally depending on from which host server the request is coming through?</p>
  <pre><code>apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    name: hello-kubernetes-ingress
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/auth-url:  http://ca6dd3adc439.ngrok.io/authorize
      nginx.ingress.kubernetes.io/auth-method: POST
      nginx.ingress.kubernetes.io/auth-snippet: |
        proxy_set_header Id &quot;queryApps&quot;;
  spec:
    rules:
    - host: &quot;hw1.yourdomain&quot;
      http:
        paths:
        - pathType: Prefix
          path: &quot;/&quot;
          backend:
            serviceName:  hello-netcore-k8s
            servicePort: 80
    - host: &quot;hw2.yourdomain&quot;
      http:
        paths:
        - pathType: Prefix
          path: &quot;/&quot;
          backend:
            serviceName: hello-kubernetes-second
            servicePort: 80
  
  
   
  </code></pre>