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,主要用來限制個別請求的帶寬
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.
設置多少bytes過后將啟動limit計數,如果小于此值則不限速
ngx_http_core_module

limit_except
沒有默認值
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
設置除了指定的http methods外其他method將被限制,允許GET就自動允許HEAD方法
ngx_http_core_module

實例

 location /downloads {
      limit_rate_after 1m;
      limit_rate 500k;
    }

    location / {
      proxy_pass http://localhost:3000;
      limit_except GET {
        deny all;
      }
    }

limit_conn

名稱 默認配置 作用域 官方說明 中文解讀 模塊

limit_conn
沒有默認值,語法 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.
指定一個zone的每個key最大連接數
ngx_http_limit_conn_module

limit_conn_zone
沒有默認值,語法 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.
第一個參數是key,第二個參數是指定zone及其存放元數據(key,current num of conns per key,zone size)的共享內存大小
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.
指定當觸發limit的時候日志打印級別
ngx_http_limit_conn_module

實例

http {
  limit_conn_zone $binary_remote_addr zone=ips:10m;
  limit_conn_zone $server_name zone=servers:10m;
  limit_conn_log_level notice;
  server {
    # these limits apply to the whole virtual server
    limit_conn ips 10;

    # only 1000 simultaneous connections to the same server_name
    limit_conn servers 1000;
  }
}

limit_req

名稱 默認配置 作用域 官方說明 中文解讀 模塊

limit_req
沒有默認值,語法 limit_req zone=name [burst=number] [nodelay];
http, server, location
Sets the shared memory zone and the maximum burst size of requests. If the requests rate exceeds the rate configured for a zone, their processing is delayed such that requests are processed at a defined rate. Excessive requests are delayed until their number exceeds the maximum burst size in which case the request is terminated with an error.
指定zone的burst大小
ngx_http_limit_req_module

limit_req_zone
沒有默認值,語法 limit_req_zone key zone=name:size rate=rate;
http
Sets parameters for a shared memory zone that will keep states for various keys. In particular, the state stores the current number of excessive requests. The key can contain text, variables, and their combination. Requests with an empty key value are not accounted.
第一個參數指定key,第二個參數指定zone名稱和元數據的內存大小,第三個參數rate指定單位時間的請求數閾值
ngx_http_limit_req_module

limit_req_log_level
limit_req_log_level error;
http, server, location
Sets the desired logging level for cases when the server refuses to process requests due to rate exceeding, or delays request processing. Logging level for delays is one point less than for refusals.
指定觸發req limit時打印的日志級別
ngx_http_limit_req_module

實例

http {
 limit_req_zone $binary_remote_addr zone=myreqzone:10m
 limit_req_log_level warn;
 server {
  ## 每個ip限定10個連接數
  ## 正常一個瀏覽器給每個host開兩到三個連接
  ## 觸發的話會返回503
  ## nodelay表示一上來就直接計算,不經過一些預熱后再計算
  limit_req zone=myreqzone burst=10 nodelay;
 }
}

以上就是我們整理的nginx中limit配置參數的全部內容,大家可以在下方的留言區討論,感謝你對三五互聯的支持。

更多關于云服務器域名注冊,虛擬主機的問題,請訪問三五互聯官網:m.shinetop.cn

贊(0)
聲明:本網站發布的內容(圖片、視頻和文字)以原創、轉載和分享網絡內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。郵箱:3140448839@qq.com。本站原創內容未經允許不得轉載,或轉載時需注明出處:三五互聯知識庫 » 解讀nginx中limit配置參數

登錄

找回密碼

注冊

主站蜘蛛池模板: 欧美色欧美亚洲高清在线视频| 日本一区二区三区在线看| 久久爱在线视频在线观看| 亚洲欧美日韩精品成人| 久久夜色精品国产噜噜亚洲sv| 国产日韩一区二区在线看| 美女内射毛片在线看免费人动物| 国产麻豆一区二区精彩视频| 99久久久国产精品免费无卡顿| 成人精品区| 国产精品亚洲专区无码破解版| 高清自拍亚洲精品二区| 影音先锋男人站| 国产超碰人人爽人人做| 人妻日韩精品中文字幕| 在线日韩日本国产亚洲| 亚洲精品综合网中文字幕| 亚洲AV福利天堂在线观看| 国产AV福利第一精品| 军人粗大的内捧猛烈进出视频 | 人妻少妇久久久久久97人妻| 国产精品亚洲片在线观看麻豆| 国产麻豆一精品一av一免费| 日韩无矿砖一线二线卡乱| 99欧美日本一区二区留学生| 免费无码一区无码东京热| 久久av无码精品人妻出轨| 国产精品天干天干综合网| 国产精品成人av电影不卡| 四虎永久免费很黄的视频| 午夜精品视频在线看| 博客| 亚洲女同性同志熟女| 欧美国产综合欧美视频| 国产精品日韩中文字幕| 日韩一区二区大尺度在线| 啊灬啊灬啊灬快灬高潮了电影片段| 亚洲综合国产伊人五月婷| av在线播放观看国产| 裕民县| 久久人人97超碰人人澡爱香蕉|