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
}
点赞(0)

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部