2020-03-20 17:40:36
限制单IP地址请求频率:
http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
限制每个IP地址发起的请求数:
http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html
http 字段加入以下内容:
# traffic control
# The module is used to limit the request processing rate per a defined key, in particular,
# the processing rate of requests coming from a single IP address.
# The limitation is done using the “leaky bucket” method.
limit_req_zone $binary_remote_addr zone=perip:10m rate=60r/s;
# The module is used to limit the number of connections per the defined key;
limit_conn_zone $binary_remote_addr zone=perconn:10m;
server {
listen 80;
server_name www.zhangluya.com;
charset utf-8;
location / {
# 队列模式 burst=1500 相当于超过限制速率的IP地址将会进入队列状态,如果api_ip zone处理完毕
# 将会放行队列中的请求,如果队列中的请求=1500满了,请求直接退回 客户端会收到一个服务器繁忙的请求;
# 排队不会一直继续 nginx的超时设置会限制排队在一定时间内的请求 直接退回 返回服务器繁忙请求.
limit_req zone=perip burst=1500;
# 非队列模式
# limit_req zone=one burst=8 nodelay; #不用队列burst=0
# allow only sixty connection per an IP address at a time
limit_conn perconn 100;
proxy_pass http://127.0.0.1:81;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
ngx_http_mirror_module- Nginx流量镜像模块用法
03-31
使用Nginx limit_req限制用户请求速率
06-06
安装并使用python requests发送http请求
07-05
Nginx http2配置教程
06-23
31-006605 Vanta显示卡使用指南V2.0.PDF
02-19
31-009107 显示卡使用指南V1.0 (nVidia Ver2832)
06-06
31-010352 显示卡使用指南(nVidia2832 Dual V1.0)
07-19
31-013359 nVIDIA Quadro4 980XGL显示卡使用指南
03-03
31005252 主板使用指南GA-6WMI2 V10
04-17
31006599联想网络适配器使用指南 宝龙达8139V1.0.pdf
06-29
31006753 845(NO LAN)主板使用指南
03-21
CentOS7源码编译安装Nginx
06-11
Q110连接数字电视时画面超出屏幕范围,如何解决?
03-15
Redis出现Could not get a resource from the pool错误关于连接数的分析
02-15
Ubuntu 16.04使用Nginx安装http Git服务器
03-11
Ubuntu 16.04配置Nginx使用GeoIP
07-12
mysql查看连接数命令show processlist详解
03-19
使用Nginx limit Requests模块限制单个IP请求速率
03-09
无线网卡连接数分钟后自动断开
05-06
ezhttp更改sshd端口
03-15
Apowersoft Unlimited软件管家 v2.0.1.5 官方版
2.68M
下载Netlimiter 下载
7.2M
下载考无忧2017职称计算机模块-用友T3财务软件 v17.1
38.95 MB
下载考无忧2018职称计算机模块-AutoCAD2004 v18.1
51.66 MB
下载考无忧2018职称计算机模块-Excel2003模块 v18.2
62.3 MB
下载httpSniffer下载
255.1K
下载ADSL宽带拨号王 v6.0.0.0
1.79 MB
下载BlueTour
2.0M
下载windows远程工具 v6.1.7600.16385
3.15 MB
下载猎豹免费wifi下载
10.29MB
下载网络文件服务器下载
837.6KB
下载职称考试计算机Excel2007
63.05 MB
下载职称考试计算机FrontPage2000
57.47 MB
下载职称考试计算机PhotoShop CS
64.3 MB
下载职称考试计算机PowerPoint 2007
77.23 MB
下载职称考试计算机Word 2003
75.53 MB
下载职称考试计算机Word 2007
73.9 MB
下载