iprate.json 907 B

123456789101112131415161718192021222324252627282930
  1. {
  2. //接口请求限制
  3. "IpRateLimiting": {
  4. "EnableEndpointRateLimiting": true,
  5. "StackBlockedRequests": false,
  6. "RealIpHeader": "X-Real-IP",
  7. "ClientIdHeader": "X-ClientId",
  8. "HttpStatusCode": 429,
  9. "EndpointWhitelist": [ "post:/system/dict/data/types", "*:/msghub/negotiate", "*:/LogOut", "*:/common/uploadfile", "*:/VerifyScan" ],
  10. "QuotaExceededResponse": {
  11. "Content": "{{\"code\":429,\"msg\":\"访问过于频繁,请稍后重试\"}}",
  12. "ContentType": "application/json",
  13. "StatusCode": 429
  14. },
  15. //通用规则,api规则,结尾一定要带*
  16. "GeneralRules": [
  17. {
  18. "Endpoint": "*:/captchaImage",
  19. //时间段,格式:{数字}{单位};可使用单位:s, m, h, d
  20. "Period": "3s",
  21. "Limit": 5
  22. },
  23. {
  24. "Endpoint": "((post)|(put)):*",
  25. "Period": "3s",
  26. "Limit": 1
  27. }
  28. ]
  29. }
  30. }