Re: using $upstream* variables inside map directive

2014-05-07 Thread Kirill K.
Ruslan, you're a hero! I just commented the following line in my existing config #proxy_cache_bypass $dontcache; and everything works now! I won't be able to comprehend such nginx's behaviour w/o your help, greatly appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249880,249

Re: using $upstream* variables inside map directive

2014-05-07 Thread Kirill K.
Thanks, Ruslan, Thing is, I tried to "debug" whether $dontcache is being set at all by exposing it via response headers (along with content-length), and it shows that $upstream_response_length is ignored by map completely, i.e. no matter where I use $dontcache, it will never get any value different

Re: using $upstream* variables inside map directive

2014-05-07 Thread Kirill K.
Probably that's the case, and I'm not sure if there's a way to use map inside upstream {...} or other context apart from http {...}, which makes your theory sound correct. What confuses me most: I googled a bit, and using map w/ $upstream_response_length is the most common way offered to avoid cach

using $upstream* variables inside map directive

2014-05-06 Thread Kirill K.
Hello, I'm trying to avoid caching of small responses from upstreams using map: map $upstream_http_content_length $dontcache { default 0; ~^\d\d$ 1; ~^\d$ 1; } Unfortunatelly, nginx seems to ignore $upstream* variables at the map processing stage, hence variables like $upstream_http_content_length