Response Header IF statement problem
Friscia, Michael
michael.friscia at yale.edu
Wed Feb 14 15:17:20 UTC 2018
Ok, I think this sends me into the correct direction. Thanks for posting the links and explaining the _bypass, I was setting both _bypass and _no_cache because I wasn’t sure.
___________________________________________
Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile
http://web.yale.edu <http://web.yale.edu/>
On 2/14/18, 10:03 AM, "nginx on behalf of webopsx" <nginx-bounces at nginx.org on behalf of nginx-forum at forum.nginx.org> wrote:
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
-
https://urldefense.proofpoint.com/v2/url?u=http-3A__nginx.org_en_docs_http_ngx-5Fhttp-5Fupstream-5Fmodule.html-23var-5Fupstream-5Fhttp-5F&d=DwICAg&c=cjytLXgP8ixuoHflwc-poQ&r=wvXEDjvtDPcv7AlldT5UvDx32KXBEM6um_lS023SJrs&m=uDTsErKM0Hidc5iw_7R5NJrlwOfkoJbgLxL4BJmCY5I&s=QEt-4cOG5TsUmuMUu8UNGiNid6whJR-CBqlmzBdUC78&e=
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.
- https://urldefense.proofpoint.com/v2/url?u=http-3A__nginx.org_en_docs_http_ngx-5Fhttp-5Fproxy-5Fmodule.html-23proxy-5Fno-5Fcache&d=DwICAg&c=cjytLXgP8ixuoHflwc-poQ&r=wvXEDjvtDPcv7AlldT5UvDx32KXBEM6um_lS023SJrs&m=uDTsErKM0Hidc5iw_7R5NJrlwOfkoJbgLxL4BJmCY5I&s=5JotmehkLwuEdHep18iz8JzWFD5LRfgDzAOuV_y8DwA&e=
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.
Posted at Nginx Forum: https://urldefense.proofpoint.com/v2/url?u=https-3A__forum.nginx.org_read.php-3F2-2C278558-2C278561-23msg-2D278561&d=DwICAg&c=cjytLXgP8ixuoHflwc-poQ&r=wvXEDjvtDPcv7AlldT5UvDx32KXBEM6um_lS023SJrs&m=uDTsErKM0Hidc5iw_7R5NJrlwOfkoJbgLxL4BJmCY5I&s=UrVYW4V-vb5FY0oXMikgzaPAKrNuFPAz897blNCH_p8&e=
_______________________________________________
nginx mailing list
nginx at nginx.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.nginx.org_mailman_listinfo_nginx&d=DwICAg&c=cjytLXgP8ixuoHflwc-poQ&r=wvXEDjvtDPcv7AlldT5UvDx32KXBEM6um_lS023SJrs&m=uDTsErKM0Hidc5iw_7R5NJrlwOfkoJbgLxL4BJmCY5I&s=AIsbNagy7Mrq1Xd-D4En3kAzGjRXaS05L_e68spvhhE&e=
More information about the nginx
mailing list