<p>I am working on a kubernetes cluster and problem faced is:</p>

<p>From UI/browser, I can see it is sending a request header called "<strong>request_id</strong>" please refer to image:</p>

<p><a href="https://i.stack.imgur.com/Y57cJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y57cJ.png" alt="enter image description here"></a></p>

<p>But while checking on backend it is unavailable. While searching through internet, I could see that people are talking about adding following entry to <strong>Ingress</strong> object:</p>

<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header request_id "$req_id";
</code></pre>

<p>But it is generating a new value for this and not passing value submitted by browser. </p>

<p>Any ideas, what might be missing here?</p>

Prateek Jain
<p>Basically, ingress-nginx-controller <strong>drops any request headers that contains "_"</strong> in them. You can find various threads which discuss this issue like,</p>

<p><a href="https://stackoverflow.com/questions/22856136/why-http-servers-forbid-underscores-in-http-header-names">Why HTTP servers forbid underscores in HTTP header names</a></p>

<p>So, I just enabled ingress controller to pass such request headers. This can be done by adding following entry to configmap "<strong>nginx-configuration</strong>"</p>

<pre><code>data:
  enable-underscores-in-headers: "true"
</code></pre>

<p>IMO, this is a much clean solution as there could be many applications that might use "_" in request headers. </p>
