max_ranges not working

Francis Daly francis at
Sat Oct 21 08:22:31 UTC 2017

On Wed, Oct 18, 2017 at 06:05:10PM -0400, eax wrote:

Hi there,

> max_ranges 0;
> to stop multirange requests "multipart download"
> but it not working i see 10 concurrent download follow in each file . 

max_ranges controls the number of accepted Range values in a single
request. It is unrelated to multiple requests.

So it probably is working for its intended purpose.

> i need to limit this value to 2 maximum range request per file.
> i usig aio threads.
> any way any body help me to fix the problem?

I think that it can't be done reliably; but if unreliable is good enough,
then you might be able to use limit_conn with limit_conn_zone based
on the browser (whatever combination of $remote_ip, $http_user_agent,
your chosen $cookie_X, and any other variables you think is good enough)
and the part of the request that corresponds to the file ($request_uri,
$uri, $args, your chosen $arg_X -- whatever matches your expectations).

"unreliable" there means "you probably won't block a determined unwanted
user; and you probably will block some wanted users; but you probably
will block the bulk of casual unwanted users". Only you can decide what
balance is correct for you.

If you need access control, use access control -- only allow authenticated
users and actively manage the ones who don't do what you want.

Francis Daly        francis at

More information about the nginx mailing list