http {
     limit_conn_zone $binary_remote_addr zone=conn_zone:10m;
     limit_req_zone $binary_remote_addr zone=req_zone:10m rate=1r/s;
     # other configuration
}
server {
     listen 80;
     server_name example.com;

     # Limit the maximum number of connections for a single client IP to 2
     limit_conn conn_zone 2;
     # Limit a single client IP to initiate a maximum of 1 request within 1s
     limit_req zone=req_zone burst=5;
     # Calculate the cumulative request traffic of the client IP, and limit the cumulative request traffic to 1GB
     set $limit_rate 128k;
     limit_rate_after 500M;
     limit_rate 1m;
     # Other processing logic
}
Likes(0)

Comment list count 0 Comments

No Comments

WeChat Self-Service

WeChat Consult

TaoBao

support@elephdev.com

发表
评论
Go
Top