Welcome! Log In Create A New Profile

Advanced

Re: Response Header IF statement problem

February 14, 2018 10:03AM
Hi,

If I understand correctly you actually don't want to cache specific responses (not bypass). The proxy_cache_bypass is only for if the response has already been cached and defines the behavior in which NGINX should serve the cached version to a client.

Therefore if I understand correctly, you should be using the upstream module for your origin definition and the proper variable will be available as $upstream_http_x_secured_page
- http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_http_

Then use the proxy_no_cache directive to determine what should and should not be cached in your configuration. If you want to simply check if the header exists and then not cache the response, you can add the upstream_http_ variable as a parameter.
- http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_no_cache

If you need to inspect the header, then look into using map instead to define the conditions you need in other to set or not set the proxy_no_cache to a value or not.

Please let me know if my understanding is correct.
Subject Author Posted

Response Header IF statement problem

wickedhangover February 14, 2018 09:12AM

Re: Response Header IF statement problem

Roman Arutyunyan February 14, 2018 10:02AM

Re: Response Header IF statement problem

wickedhangover February 14, 2018 10:04AM

Re: Response Header IF statement problem

webopsx February 14, 2018 10:08AM

Re: Response Header IF statement problem

wickedhangover February 14, 2018 04:04PM

Re: Response Header IF statement problem

webopsx February 14, 2018 04:39PM

Re: Response Header IF statement problem

wickedhangover February 14, 2018 04:46PM

Re: Response Header IF statement problem

pbooth February 14, 2018 05:16PM

Re: Response Header IF statement problem

wickedhangover February 15, 2018 08:04AM

Re: Response Header IF statement problem

wickedhangover February 15, 2018 08:24AM

Re: Response Header IF statement problem

Francis Daly February 16, 2018 07:38AM

Re: Response Header IF statement problem

wickedhangover February 16, 2018 08:52AM

Re: Response Header IF statement problem

Francis Daly February 16, 2018 10:40AM

Re: Response Header IF statement problem

webopsx February 14, 2018 10:03AM

Re: Response Header IF statement problem

wickedhangover February 14, 2018 10:18AM

Re: Response Header IF statement problem

webopsx February 14, 2018 05:07PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 256
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready