nginx limit 설정 매개 변수 해석
본문 은 주로 ngx 를 해석 합 니 다.http_core_module、ngx_http_limit_conn_module 및 ngxhttp_limit_req_module 의 limit 관련 설정 매개 변수 입 니 다.
limit_rate
명칭.
기본 설정
역할 영역
공식 설명
중국어 해독
모듈
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.
1 초 에 이 연결 을 다운로드 할 수 있 는 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
기본 값 없 음, 문법 limitconn 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
기본 값 없 음, 문법 limitconn_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
기본 값 없 음, 문법 limitreq 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
기본 값 없 음, 문법 limitreq_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;
}
}
doc
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.