Welcome! Log In Create A New Profile

Advanced

Re: Max File Size Allowed In Cache

Maxim Dounin
October 01, 2014 07:26AM
Hello!

On Tue, Sep 30, 2014 at 11:38:59PM -0400, martinproinity wrote:

> Thanks Maxim. Is it possible the filter on a value "larger than" or "smaller
> than"? How would the regex in the map block look like? e.g. smaller than
> 1000000?
>
> I tried something like this, which is not working:
> map $upstream_http_content_length $docache {
> default 0;
> "~*([1-9][0-9]{0,6}|1000)$" 1;
> }

You've forgot start anchor. Something like this should work to
disable cache for responses with Content-Length larger than
1000000:

map $upstream_http_content_length $nocache {
default 1;
"~^[1-9]{0,6}$" 0;
}

proxy_no_cache $nocache;

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Max File Size Allowed In Cache

abstein2 September 15, 2014 03:21PM

Re: Max File Size Allowed In Cache

martinproinity September 30, 2014 01:35AM

Re: Max File Size Allowed In Cache

Maxim Dounin September 30, 2014 08:06AM

Re: Max File Size Allowed In Cache

martinproinity September 30, 2014 11:38PM

Re: Max File Size Allowed In Cache

Maxim Dounin October 01, 2014 07:26AM

Re: Max File Size Allowed In Cache

martinproinity October 01, 2014 09:01PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready