Response Header IF statement problem

Friscia, Michael michael.friscia at
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 <>

On 2/14/18, 10:03 AM, "nginx on behalf of webopsx" <nginx-bounces at on behalf of nginx-forum at> wrote:

    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
    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. 
    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:
    nginx mailing list
    nginx at

More information about the nginx mailing list