2013-03-21 82 views

回答

0

我不知道nginx会做到这一点的函数。但是,您可以使用auth_request模块将所有传入流量交给检查流量并应用速率限制规则的上游Web服务。

location/{ 
    auth_request /ratelimiter; 

    .. 
    Normal configuration settings 
} 

location /ratelimiter { 
    proxy_pass http://internalratelimitinghost; 
    # return a HTTP 200 to allow the request 
    # return anything else to deny it 
} 

nginx auth_request。该模块默认不包含,因此您需要将其编译进去。