ruoyi-gateway.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # 安全配置
  2. security:
  3. # 不校验白名单
  4. ignore:
  5. whites:
  6. - /auth/code
  7. - /auth/logout
  8. - /auth/login
  9. - /auth/binding/*
  10. - /auth/register
  11. - /auth/tenant/list
  12. - /resource/sms/code
  13. - /resource/sse/close
  14. - /*/v3/api-docs
  15. - /*/error
  16. - /csrf
  17. - /warm-flow-ui/**
  18. spring:
  19. cloud:
  20. # 网关配置
  21. gateway:
  22. # 打印请求日志(自定义)
  23. requestLog: true
  24. server:
  25. webflux:
  26. # Gateway WebFlux 转发使用的 Reactor Netty 连接池配置
  27. httpclient:
  28. pool:
  29. # 使用固定连接池,避免 SSE 长连接占满默认连接池后快速拒绝普通请求
  30. type: fixed
  31. # 总最大连接数
  32. max-connections: 1000
  33. # 连接池满时等待可用连接的时间,单位毫秒
  34. acquire-timeout: 3000
  35. # 空闲连接最大保留时间
  36. max-idle-time: 30s
  37. # 后台空闲连接回收间隔
  38. eviction-interval: 30s
  39. # SSE 场景通常不设置响应超时,避免长连接被网关主动断开
  40. # response-timeout: 60s
  41. discovery:
  42. locator:
  43. lowerCaseServiceId: true
  44. enabled: true
  45. routes:
  46. # 认证中心
  47. - id: ruoyi-auth
  48. uri: lb://ruoyi-auth
  49. predicates:
  50. - Path=/auth/**
  51. filters:
  52. - StripPrefix=1
  53. # 代码生成
  54. - id: ruoyi-gen
  55. uri: lb://ruoyi-gen
  56. predicates:
  57. - Path=/tool/**
  58. filters:
  59. - StripPrefix=1
  60. # 系统模块
  61. - id: ruoyi-system
  62. uri: lb://ruoyi-system
  63. predicates:
  64. - Path=/system/**,/monitor/**
  65. filters:
  66. - StripPrefix=1
  67. # 资源服务
  68. - id: ruoyi-resource
  69. uri: lb://ruoyi-resource
  70. predicates:
  71. - Path=/resource/**
  72. filters:
  73. - StripPrefix=1
  74. # workflow服务
  75. - id: ruoyi-workflow
  76. uri: lb://ruoyi-workflow
  77. predicates:
  78. - Path=/workflow/**
  79. filters:
  80. - StripPrefix=1
  81. # warm-flow服务
  82. - id: warm-flow
  83. uri: lb://ruoyi-workflow
  84. predicates:
  85. - Path=/warm-flow-ui/**,/warm-flow/**
  86. # 演示服务
  87. - id: ruoyi-demo
  88. uri: lb://ruoyi-demo
  89. predicates:
  90. - Path=/demo/**
  91. filters:
  92. - StripPrefix=1
  93. # MQ演示服务
  94. - id: ruoyi-test-mq
  95. uri: lb://ruoyi-test-mq
  96. predicates:
  97. - Path=/test-mq/**
  98. filters:
  99. - StripPrefix=1