Yup, again, you’re right! I’ve moved the config around, so that I’m testing for any ‘true’ value in the proxy_no_cache & proxy_bypass_cache directives (removing the existing set_by_lua block). However, it’s still not behaving as I’d expect. In the following scenario (note comments): map $upstream_http_x_no_cache $no_cache_header { "" 0; defby ptylr - Nginx Mailing List - English
Hi Maxim, Ok, thanks for the clarification. So to confirm, we are looking for the value of the sent header from the upstream, to identify whether the content should be served from the cache, or the upstream. Does this therefore mean that the code that we have below, will check for the X-No-Cache header, and if present, will always render the content from the upstream (no cache), and that if notby ptylr - Nginx Mailing List - English
Hi Maxim, Thanks for your response. You’re right! Using the map did work (I thought I’d tried that, but must have been tired!). So, now I have one other challenge, the value of $foo that you define below is needed to identify whether to cache the response of not. The only issue is that I have a number of other directives that I also need to add into the mix - therefore I use the set_by_lua codby ptylr - Nginx Mailing List - English
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 peby ptylr - Nginx Mailing List - English