#配合限制并发数使用
limit_conn_zone $binary_remote_addr zone=addr:10m;
#limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
#root /usr/local/tomcat/webapps/ROOT;
index index.php index.html index.htm;
}
#限制并发数
location /download/{
limit_conn addr 1;#此处的并发数为1,
limit_rate 50k; #带宽为50k
limit_req zone=one burst=5;#最大连接数为5
}
#测试:
[#配合限制并发数使用
limit_conn_zone $binary_remot