The point I was trying to make is that in this case for instance, ...
[code]
set $donot_cache 0;
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $donot_cache 1;
}
set $test $donot_cache;
[/code]
... $test will always be equal to 0 as any variable set within the 'if' block is not exposed outside the block AFAIK.
So when you run ...
[code]
set $donot_cache 0;
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $donot_cache 1;
}
...
fastcgi_no_cache $donot_cache;
[/code]
... '$donot_cache' will always resolve to null.
Again, this is AFAIK based on stuff I have read here and there.
See here for instance: http://forum.nginx.org/read.php?2,25197,25197#msg-25197