<p>I want to read the request URI(excluding hostname and request params) and forward it in a custom header to an upstream server. I have been through several blogs where they have mentioned to use $request_uri but its not working.</p>

<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
    proxy_set_header RequestURI $request_uri
</code></pre>

<p>May I know which language is used to write scripts in annotation snippets? And is there is any list of variables which are by-default provided by ingress controller that we can use inside annotations?</p>

<p>Thanks</p>

Jaraws
<blockquote>
  <p>which language is used to write scripts in annotation snippets?</p>
</blockquote>

<p>There are no special language, the format is the Nginx configuration format. </p>

<p>Everything you put there will be added to a <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html?&amp;_ga=2.121880715.180798959.1590354221-351902990.1590354221#location" rel="nofollow noreferrer">location</a> section related to your Ingress route in an Nginx configuration generated by Ingress controller.</p>

<blockquote>
  <p>is there is any list of variables which are by-default provided by ingress controller that we can use inside annotations?</p>
</blockquote>

<p><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#variables" rel="nofollow noreferrer">Here</a> is a list of embedded Nginx variables.</p>
