Response Header IF statement problem

Friscia, Michael michael.friscia at
Wed Feb 14 21:02:35 UTC 2018

Ok, so I did this and it worked and then it stopped working, then it worked again and then stopped working. I literally used the code below, the map appears right above my server {}  block. When it worked I was passing a header with the $nocache value set and it was consistently returning the correct value. What I don’t understand is that I did not change the code that runs this, I made some other non related changes and then this stops working.

What would cause the map directive to stop working? Or maybe my question is what would cause the map directive to cache a value to that variable and then not change it even with nginx restarts?

Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile <>

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

    You can use map for this...
    map $upstream_http_x_secured_page $nocache {
        "search string"		"1"
        default			"";
    location /foo {
        proxy_no_cache $nocache;
    Posted at Nginx Forum:
    nginx mailing list
    nginx at

More information about the nginx mailing list