当前位置:网站首页>nignx配置单ip限流
nignx配置单ip限流
2022-06-27 03:46:00 【hshshshshs1】
1.http里面的配置
limit_req_zone $binary_remote_addr zone=rateLimit:10m rate=2r/s;

1.$binary_remote_addr 是设置的单ip,不是总的并发量
2.rateLimit是一个变量跟server里面写的一样就可以,有的是认驼峰,可以改为ratelimit等
3.2r/s 是针对同一个ip每秒限制2次请求
3.limit_req_zone必须结合limit_req才能生效
2.server里面的配置
location ~ \.php$ {
limit_req zone=rateLimit burst=5 nodelay;
……
}

1.burst 是桶的概念,可以理解为队列,
2.若rate=2r/s,burst =1,在所有请求不释放的情况下,前2个请求正常访问,第3个请求进入队列,第4个请求的时候就会报503
3.测试的时候就是快速的刷新就可以
3 .错误
我本地是laradock,直接添加就可以,但是宝塔上配置有一些区别
1.在宝塔上的配置,http里面的limit_req_zone $binary_remote_addr zone=rateLimit:10m rate=2r/s;是一样的
2.server里面的配置
先注释了,换成下面的代码就可以了
里面的代码是从enable-php-73.conf里面粘出来的
边栏推荐
- Semantic version 2.0.0
- 2021:Graphhopper: Multi-Hop Scene Graph Reasoning for Visual Question Answering
- 2021:Greedy Gradient Ensemble for Robust Visual Question Answering
- 2022 operation of simulated examination platform for tea artist (Senior) work license question bank
- Promise source code class version [III. promise source code] [detailed code comments / complete test cases]
- 事业观、金钱观与幸福观
- Super détaillé, 20 000 caractères détaillés, mangez à travers es!
- PAT甲级 1018 Public Bike Management
- 2020:MUTANT: A Training Paradigm for Out-of-Distribution Generalizationin Visual Question Answering
- 对数器
猜你喜欢

LDR6028 手机设备一边充电一边OTG传输数据方案

MATLAB | 三个趣的圆相关的数理性质可视化

Static timing analysis OCV and time derive

MobileNet系列(4):MobileNetv3网络详解
![[promise I] introduction of promise and key issues of hand rolling](/img/14/94bd986d3ac8a0db35c83b4234fa8a.png)
[promise I] introduction of promise and key issues of hand rolling

2021:Beyond Question-Based Biases:Assessing Multimodal Shortcut Learning in Visual Question Answeri

Pat grade a 1025 pat ranking

Argo Workflows —— Kubernetes的工作流引擎入门

2021:passage retrieval for outside knowledgevisual question answering

Anaconda3 is missing a large number of files during and after installation, and there are no scripts and other directories
随机推荐
mysql数据库基础:DQL数据查询语言
文旅夜游|以沉浸式视觉体验激发游客的热情
PAT甲级 1025 PAT Ranking
PAT甲级 1024 Palindromic Number
苹果唯一图谱架构常识
【promise一】promise的介绍与手撸的关键问题
QIngScan使用
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
Uni-app 之uParse 富文本解析 完美解析富文本!
我是怎样简化开源系统中的接口的开发的?
Pat grade a 1018 public bike management
Fplan powerplan instance
Kotlin Compose 隐式传参 CompositionLocalProvider
PAT甲级 1018 Public Bike Management
2022 Chinese pastry (Advanced) recurrent training question bank and online simulation test
PAT甲级 1023 Have Fun with Numbers
Pat grade a 1023 have fun with numbers
How does the brain do arithmetic? Both addition and subtraction methods have special neurons, and the symbol text can activate the same group of cell sub journals
MATLAB | 基于分块图布局的三纵坐标图绘制
Easy to use plug-ins in idea