国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

解讀nginx中l(wèi)imit配置參數(shù)

2024-08-30 12:25:13
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文主要解析一下ngx_http_core_module、ngx_http_limit_conn_module以及ngx_http_limit_req_module中的limit相關(guān)配置參數(shù)。

limit_rate

名稱(chēng) 默認(rèn)配置 作用域 官方說(shuō)明 中文解讀 模塊
limit_rate limit_rate 0; http, server, location, if in location 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. 指定每秒該連接能下載的bytes,主要用來(lái)限制個(gè)別請(qǐng)求的帶寬 ngx_http_core_module
limit_rate_after limit_rate_after 0; http, server, location, if in location Sets the initial amount after which the further transmission of a response to a client will be rate limited. 設(shè)置多少bytes過(guò)后將啟動(dòng)limit計(jì)數(shù),如果小于此值則不限速 ngx_http_core_module
limit_except 沒(méi)有默認(rèn)值 location Limits allowed HTTP methods inside a location. The method parameter can be one of the following: GET, HEAD, POST, PUT, DELETE, MKCOL, COPY, MOVE, OPTIONS, PROPFIND, PROPPATCH, LOCK, UNLOCK, or PATCH. Allowing the GET method makes the HEAD method also allowed 設(shè)置除了指定的http methods外其他method將被限制,允許GET就自動(dòng)允許HEAD方法 ngx_http_core_module

實(shí)例

 location /downloads {      limit_rate_after 1m;      limit_rate 500k;    }    location / {      proxy_pass http://localhost:3000;      limit_except GET {        deny all;      }    }

limit_conn

名稱(chēng) 默認(rèn)配置 作用域 官方說(shuō)明 中文解讀 模塊
limit_conn 沒(méi)有默認(rèn)值,語(yǔ)法 limit_conn zone number; http, server, location Sets the shared memory zone and the maximum allowed number of connections for a given key value. When this limit is exceeded, the server will return the error in reply to a request. 指定一個(gè)zone的每個(gè)key最大連接數(shù) ngx_http_limit_conn_module
limit_conn_zone 沒(méi)有默認(rèn)值,語(yǔ)法 limit_conn_zone key zone=name:size; http Sets parameters for a shared memory zone that will keep states for various keys. In particular, the state includes the current number of connections. The key can contain text, variables, and their combination. Requests with an empty key value are not accounted. 第一個(gè)參數(shù)是key,第二個(gè)參數(shù)是指定zone及其存放元數(shù)據(jù)(key,current num of conns per key,zone size)的共享內(nèi)存大小 ngx_http_limit_conn_module
limit_conn_log_level limit_conn_log_level error; http, server, location Sets the desired logging level for cases when the server limits the number of connections. This directive appeared in version 0.8.18. 指定當(dāng)觸發(fā)limit的時(shí)候日志打印級(jí)別 ngx_http_limit_conn_module
發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿坝| 温泉县| 阳春市| 修武县| 德化县| 全州县| 清苑县| 桂平市| 舒兰市| 吉林省| 韶关市| 浏阳市| 河东区| 广西| 南投市| 金昌市| 包头市| 沂南县| 屏边| 调兵山市| 云阳县| 景泰县| 武冈市| 鲜城| 梁山县| 融水| 固安县| 清新县| 同德县| 庆安县| 永修县| 平潭县| 宁阳县| 呼和浩特市| 崇义县| 牡丹江市| 兴仁县| 内江市| 石泉县| 漾濞| 青河县|