前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >重识Nginx - 09 使用Nginx内置变量$limit_rate实现带宽限速

重识Nginx - 09 使用Nginx内置变量$limit_rate实现带宽限速

作者头像
小小工匠
发布2022-10-04 17:26:45
4220
发布2022-10-04 17:26:45
举报
文章被收录于专栏:小工匠聊架构小工匠聊架构

文章目录

在这里插入图片描述
在这里插入图片描述

官网

https://nginx.org/en/docs/

在这里插入图片描述
在这里插入图片描述

点击 Alphabetical index of variables

在这里插入图片描述
在这里插入图片描述

找到 https://nginx.org/en/docs/http/ngx_http_core_module.html#var_limit_rate

在这里插入图片描述
在这里插入图片描述

$limit_rate

在这里插入图片描述
在这里插入图片描述

Limits the rate of response transmission to a client. The rate is specified in bytes per second. The zero value disables rate limiting. The limit is set per a request, and so if a client simultaneously opens two connections, the overall rate will be twice as much as the specified limit.


实操

修改配置文件

在这里插入图片描述
在这里插入图片描述
代码语言:javascript
复制
[root@VM-0-7-centos ~]# vim ng/artisan_ng/conf/nginx.conf
[root@VM-0-7-centos ~]#
[root@VM-0-7-centos ~]#
[root@VM-0-7-centos ~]#
[root@VM-0-7-centos ~]# ./ng/artisan_ng/sbin/nginx -s reload
[root@VM-0-7-centos ~]#

重新访问

在这里插入图片描述
在这里插入图片描述

可以看到 $limit_rate生效了

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-10-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 官网
  • $limit_rate
  • 实操
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档