Gateway添加通过IP限流
This commit is contained in:
@@ -40,20 +40,38 @@ spring:
|
||||
predicates:
|
||||
- Path=/user/**
|
||||
- Method=GET,POST
|
||||
filters: # 路由过滤器,使用自定义的限流过滤器工厂
|
||||
- name: RateLimitByIp # 设置每秒允许5个请求,每次请求需要1个令牌
|
||||
args:
|
||||
rate: 5.0
|
||||
permits: 1
|
||||
|
||||
- id: access
|
||||
uri: lb://microservice-provider-access
|
||||
predicates:
|
||||
- Path=/access/**
|
||||
- Method=GET,POST
|
||||
filters: # 路由过滤器,使用自定义的限流过滤器工厂
|
||||
- name: RateLimitByIp # 设置每秒允许5个请求,每次请求需要1个令牌
|
||||
args:
|
||||
rate: 5.0
|
||||
permits: 1
|
||||
|
||||
- id: access-websocket
|
||||
uri: lb:ws://microservice-provider-access
|
||||
predicates:
|
||||
- Path=/access/websocket/**
|
||||
|
||||
- id: shop
|
||||
uri: lb://microservice-provider-shop
|
||||
predicates:
|
||||
- Path=/shop/**
|
||||
- Method=GET,POST
|
||||
filters: # 路由过滤器,使用自定义的限流过滤器工厂
|
||||
- name: RateLimitByIp # 设置每秒允许5个请求,每次请求需要1个令牌
|
||||
args:
|
||||
rate: 5.0
|
||||
permits: 1
|
||||
|
||||
- id: test1
|
||||
uri: lb://microservice-provider-test
|
||||
|
Reference in New Issue
Block a user