본문 바로가기

리눅스

[NGINX] nginx limit_conn | limit_req 모듈 사용하기

반응형

nginx limit_conn | limit_req 모듈 사용하기

 

nginx limit_conn 모듈

$ vim /etc/nginx/nginx.conf
http {
...
    limit_conn_zone $http_x_forwarded_for zone=ddos_conn:10m;
    limit_conn_zone $server_name zone=rate_conn:10m;
    limit_conn_log_level info;
    limit_conn_status 571;
...
}

$ vim /etc/nginx/conf.d/default.conf
server {
    listen 80;
...
    limit_conn ddos_conn 1;
...
}

 

nginx limit_req 모듈

$ vim /etc/nginx/nginx.conf
http {
...
    limit_req_zone $http_x_forwarded_for zone=ddos_req:10m rate=6r/m;
    limit_req_log_level info;
    limit_req_status 571;
...
}

$ vim /etc/nginx/conf.d/default.conf
server {
    listen 80;
...
    limit_req zone=ddos_req burst=30 nodelay;
...
}

 

ngx_http_limit_conn_module

 

Module ngx_http_limit_conn_module

Module ngx_http_limit_conn_module The ngx_http_limit_conn_module module is used to limit the number of connections per the defined key, in particular, the number of connections from a single IP address. Not all connections are counted. A connection is coun

nginx.org

 

ngx_http_limit_req_module

 

Module ngx_http_limit_req_module

Module ngx_http_limit_req_module The ngx_http_limit_req_module module (0.7.21) 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

nginx.org

 

 

 

 

728x90
반응형

'리눅스' 카테고리의 다른 글

리눅스 password hashing 알고리즘 변경하기  (0) 2020.10.05
[명령어] grep, egrep, fgrep 명령어  (2) 2020.10.05
docker rmi 명령어  (0) 2020.10.05
[명령어] docker system prune  (0) 2020.10.05
[명령어] docker rm  (0) 2020.10.05