Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Limiting rate by given variables(like $request_uri, $remote_addr, etc..).
branch: master

This branch is 7 commits behind bigplum:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
config
ngx_http_limit_traffic_rate_filter_module.c

README

Notes on the limit_traffic_rate module
---

To install, compile nginx with this ./configure option:

    --add-module=path/to/this/directory

Nginx directive limit_rate could limit connection's speed, and limit_conn could
limit connection number by given variable. If the client is a browser, it only
open one connection to the server. The speed will be limited to limit_rate, unless
the client is a multi-thread download tool.

The limit_traffic_rate module record connection numbers by the variable like 
limit_conn module, and set limit_rate to limit_traffic_rate/cur_conn_number. So
if client is a browser, the download max rate will be limit_traffic_rate. If client
is a multi-thread tool, the total rate also be limited to limit_traffic_rate.

The limit_traffic_rate module need to use a share memory pool. Directive syntax
is same to limit_zone. 

    http {
        limit_traffic_rate_zone   rate $remote_addr 32m;
        
        server {
            location /download/ {
                limit_traffic_rate  rate 20k;
            }
        }
    }

Something went wrong with that request. Please try again.