nginx如何限速?

nginx自从1.1.8版本发布后将limit_conn更换为limit_conn_zone 。

对应则需要修改配置文件

在nginx.conf的http下面加入下面代码
limit_conn_zone $binary_remote_addr zone=addr:10m;
在站点的server区域加入下面代码

location / {
limit_conn addr 1;
limit_rate 300k;
}
这样限速为300k
然后重载nginx配置文件 service nginx reload
交流QQ:2881064156

posted @ 2016-08-20 09:47  鼎峰凡凡  阅读(323)  评论(0编辑  收藏  举报