If statement for Content-Length

Hi Guys,

I’ve been trying to work out if this can be done or not with not much
luck

I want to see if I can do something like this

If (Content-Length < 1024){
Return 403;
}

Im guessing this can’t be done, however it would get around a caching
issue I am having with large files.

Kingsley

2010/1/30 Kingsley F. [email protected]

Im guessing this can’t be done, however it would get around a caching issue I am having with large files.

what is the caching issue you’re having with large files ?

Mainly I just don’t want to cache them,

The site is hit by a massive amount of small files and some larger, due
to the setup I can’t separate them (customers are involved). So I want
to be able to only cache files under say 5-10mb and just let everything
else proxy_pass normally.

Kingsley

On Sat, Jan 30, 2010 at 8:47 PM, Kingsley F.
[email protected] wrote:

I want to see if I can do something like this

If (Content-Length < 1024){
Return 403;
}

Use the “client_max_body_size” directive for it:

client_max_body_size 1k;

See Module ngx_http_core_module

Cheers,
-agentzh