I am trying to removed all cookies from response headers if Pragma: no-cache is not present in the headers in Nginx. I am trying to achieve this as below
if ( $sent_http_pragma !~* "no-cache"){ more_clear_headers "Set-Cookie*";
break; }
if ( $sent_http_cache_control !~* "no-cache"){ more_clear_headers "Set-Cookie*";
break; }
The if condition here fails and the cookies are cleared for everything, even if the condition is not satisifed, but the header is present. Also tried using map as
map $sent_http_pragma $pval{
"~.* no-cache" 1;
}
map $sent_http_cache_control $ccval{
"~.* no-cache" 1;
}
but always getting default blank value. Appreciate any help in this regards.
Thanks
if ( $sent_http_pragma !~* "no-cache"){ more_clear_headers "Set-Cookie*";
break; }
if ( $sent_http_cache_control !~* "no-cache"){ more_clear_headers "Set-Cookie*";
break; }
The if condition here fails and the cookies are cleared for everything, even if the condition is not satisifed, but the header is present. Also tried using map as
map $sent_http_pragma $pval{
"~.* no-cache" 1;
}
map $sent_http_cache_control $ccval{
"~.* no-cache" 1;
}
but always getting default blank value. Appreciate any help in this regards.
Thanks