nginx-每个url的速率限制

nginx-每个url的速率限制,nginx,rate-limiting,nginx-config,Nginx,Rate Limiting,Nginx Config,我遇到了一个问题,我试图为单个位置块(如“location/{}”)中的每个URL设置速率限制 最后,url“/example/1”每秒可以发送5个请求,而“/example/2”每秒可以发送另外5个请求 limit_req_zone $request_uri zone=one:10m rate=6r/m; location / { proxy_pass http://app:8000; proxy_set_header Host $host; proxy_set_

我遇到了一个问题,我试图为单个位置块(如“location/{}”)中的每个URL设置速率限制

最后,url“/example/1”每秒可以发送5个请求,而“/example/2”每秒可以发送另外5个请求

limit_req_zone $request_uri zone=one:10m rate=6r/m;



location / {
    proxy_pass http://app:8000;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    limit_req zone=one;
}