title: nginx ingress annotations to redirect to authentication and get back headers
body: <p>I've the below nginx conf file to redirect all the requests (by default) to /auth (of my service) and then get back a response header (foo_id). This header will be forwarded to the original request URI triggered by user. The below works properly with the nginx.
  ...</p>
  
  <pre><code>location / 
  {
      auth_request /auth;
      auth_request_set $foo_id $upstream_http_foo_id;
      proxy_pass    $request_uri
      proxy_set_header X-foo-Token $foo_id;
      root   html;
      index  index.html index.htm;
  }
  
  location /auth 
  {
      internal;
      proxy_pass   https://myhost/myservice;
      proxy_pass_request_body off;
      proxy_set_header        Content-Length "";
      proxy_set_header        X-Original-URI $request_uri;
  }
  </code></pre>
  
  <hr>
  
  <p>But I need the corresponding ingress rules/annotations that are required to achieve the above use case. I couldn't get the respective auth/proxy-pass related annotations. Kindly help out.</p>