sent_http_HEADER Volatile under Nginx 1.2.4

Paul Taylor me at
Thu Dec 12 19:19:56 UTC 2013

I’m in the process of making some amends to an environment, where my upstream servers are sending a custom header (X-No-Cache), which I need to detect and alter caching rules within the configuration.

The custom header is visible within the output, and I can re-output it as another header through configuration (i.e. add_header  X-Sent-No-Cache $sent_http_x_no_cache; ).

However, as soon as I perform any type of testing of this custom header, it disappears.

For example, if I was to perform a map on the custom header, try to set an Nginx variable to the value of the header, or test within an IF statement, any future call to this header is no longer possible. Additionally any setting or testing of the header fails.

Unfortunately I have little control of the upstream, so cannot use an alternative method (such as proper Cache-Control headers).

Has anyone experienced similar behaviour, or have any pearls of wisdom?

Thanks in advance,


More information about the nginx mailing list