nginx 新语法 limit_conn_zone 替换 limit_conn 用法
2015-08-17 23:10
726 查看
nginx自从1.1.8版本发布后将limit_conn更换为limit_conn_zone 。对应则需要修改配置文件。官方公告:syntax: limit_zone name $variable size;default: —
context: httpThis directive is made obsolete in version 1.1.8, an equivalent limit_conn_zone directive with a changed syntax should be used instead:limit_conn_zone $variable zone=name:size;limit_conn_zone的描述:When several limit_conn directives are specified, any configured limit will apply. For example, the following configuration will limit the number of connections to the server per client IP and at the same time will limit the total number of connections to the virtual host:limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;server {
…
limit_conn perip 10;
limit_conn perserver 100;
}These directives are inherited from the previous level if and only if there are no limit_conn directives on the current level. 对应conf文件夹中的nginx.conf文件,将limit_conn替换为limit_conn_zone。使用于http示例:limit_conn_zone $binary_remote_addr zone=perip:10m; #容器共使用10M的内存来对于IP传输开销 对应的虚拟主机文件,将原来的limit_conn one 替换为 limit_conn perip。使用于server示例:limit_conn perip 10; # 每个IP使用10个连接。
context: httpThis directive is made obsolete in version 1.1.8, an equivalent limit_conn_zone directive with a changed syntax should be used instead:limit_conn_zone $variable zone=name:size;limit_conn_zone的描述:When several limit_conn directives are specified, any configured limit will apply. For example, the following configuration will limit the number of connections to the server per client IP and at the same time will limit the total number of connections to the virtual host:limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;server {
…
limit_conn perip 10;
limit_conn perserver 100;
}These directives are inherited from the previous level if and only if there are no limit_conn directives on the current level. 对应conf文件夹中的nginx.conf文件,将limit_conn替换为limit_conn_zone。使用于http示例:limit_conn_zone $binary_remote_addr zone=perip:10m; #容器共使用10M的内存来对于IP传输开销 对应的虚拟主机文件,将原来的limit_conn one 替换为 limit_conn perip。使用于server示例:limit_conn perip 10; # 每个IP使用10个连接。
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- nginx中http核心模块的配置指令2
- 网站502与504错误分析
- 艰难完成 nginx + puma 部署 rails 4的详细记录
- 把Lua编译进nginx步骤方法
- web 应用中常用的各种 cache详解
- Linux系统上配置Nginx+Ruby on Rails+MySQL超攻略
- window+nginx+php环境配置 附配置搭配说明
- IP安全策略限制IP进入远程桌面设置方法
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- 将PHP从5.3.28升级到5.3.29时Nginx出现502错误
- 基于Nginx0.8.54+PHP5.3.4+MySQL5.5.8的全新LNMP稳定版架构搭建的VPS
- Nginx(PHP/fastcgi)的PATH_INFO问题
- 如何让Nginx支持中文文件名具体设置步骤
- Nginx upstream的5种权重分配方式分享
- 分析nginx日志并屏蔽采集者ip(nginx屏蔽ip配置实例)