Re: using $upstream* variables inside map directive

2020-11-12 Thread Francis Daly
On Thu, Nov 12, 2020 at 11:00:09AM -0500, unoobee wrote: Hi there, > > And you are reporting that it does not ever write to "ssd_cache". > Yes, this is correct. I want to choose the cache location based on the size > of the cached file Logically, you can't. You can only choose the cache locatio

Re: using $upstream* variables inside map directive

2020-11-12 Thread unoobee
> And you are reporting that it does not ever write to "ssd_cache". Yes, this is correct. I want to choose the cache location based on the size of the cached file I want to get the behavior described in the article, but only with the file size in the map directive, I assume I need $sent_http_conte

Re: using $upstream* variables inside map directive

2020-11-12 Thread Francis Daly
On Thu, Nov 12, 2020 at 04:58:31AM -0500, unoobee wrote: Hi there, > My configuration looks like this: Thanks for this. It looks like you are setting "proxy_cache" to always try to read from "hdd_cache"; but you want it to sometimes write to "ssd_cache" instead. And you are reporting that it d

Re: using $upstream* variables inside map directive

2020-11-12 Thread unoobee
My configuration looks like this: proxy_cache_path /cache/ssd keys_zone=ssd_cache:10m levels=1:2 inactive=600s max_size=100m; proxy_cache_path /cache/hdd keys_zone=hdd_cache:10m levels=1:2 inactive=600s max_size=100m; upstream backend { server www.test.com:443; }

Re: using $upstream* variables inside map directive

2020-11-12 Thread Francis Daly
On Thu, Nov 12, 2020 at 02:33:49AM -0500, unoobee wrote: Hi there, > I tried using $upstream_http_content_length inside the map directive with > the "volatile" parameter to specify the proxy_cache behavior, but the map > still uses the default value. What's your config? > Is there any way to se

Re: using $upstream* variables inside map directive

2020-11-11 Thread unoobee
I tried using $upstream_http_content_length inside the map directive with the "volatile" parameter to specify the proxy_cache behavior, but the map still uses the default value. Is there any way to set the proxy_cache behavior depending on $upstream_http_content_length via the map directive? Poste

Re: using $upstream* variables inside map directive

2020-11-11 Thread Ruslan Ermilov
On Wed, Nov 11, 2020 at 12:55:30PM -0500, unoobee wrote: > Ruslan, could you send that patch for "map"? I would like to check it. The "volatile" parameter of the "map" directive is available since nginx version 1.11.7. ___ nginx mailing list nginx@nginx.

Re: using $upstream* variables inside map directive

2020-11-11 Thread unoobee
Ruslan, could you send that patch for "map"? I would like to check it. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,249880,289960#msg-289960 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

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 Ruslan Ermilov
On Wed, May 07, 2014 at 08:53:56AM -0400, Kirill K. wrote: > 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 m

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 Ruslan Ermilov
On Wed, May 07, 2014 at 01:38:04AM -0400, Kirill K. wrote: > 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

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

Re: using $upstream* variables inside map directive

2014-05-07 Thread Jonathan Matthews
On 7 May 2014 06:38, Kirill K. wrote: > 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

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