- IP字段支持IP v4和v6值以及范围,如 “192.168.0.0/24”, “fe80::/10” 或 “192.168.0.0-192.168.0.255”
- ip配置
"127.0.0.1","::1/10","192.168.0.189","124.70.4.247","::ffff:124.70.4.247"
参考文档
- 本机:”127.0.0.1”,”::ffff:127.0.0.1”
- 局域网:”199.168.1.0/24”,”::ffff:192.168.1.28”
- 服务器:”::ffff:124.70.4.247”,”::ffff:123.97.178.248”, “124.70.4.247”
{
"IpRateLimiting": {
"EnableEndpointRateLimiting": true,
"StackBlockedRequests": false,
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"IpWhitelist": [ "127.0.0.1","::ffff:127.0.0.1","199.168.1.0/24","::ffff:192.168.1.28", "::ffff:124.70.4.247","::ffff:123.97.178.248", "124.70.4.247" ], //白名单
"EndpointWhitelist": [],
"ClientWhitelist": [],
"QuotaExceededResponse": {
"Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}",
"ContentType": "application/json",
"StatusCode": 429
},
"HttpStatusCode": 429, //返回状态码
"GeneralRules": [ //api规则,结尾一定要带*
{
"Endpoint": "*",
"Period": "1m",
"Limit": 0
}
]
}
}