ruoyi-gateway.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # 安全配置
  2. security:
  3. # 防止XSS攻击
  4. xss:
  5. enabled: true
  6. excludeUrls:
  7. - /system/notice
  8. # 不校验白名单
  9. ignore:
  10. whites:
  11. - /auth/code
  12. - /auth/logout
  13. - /auth/login
  14. - /auth/binding/*
  15. - /auth/social/callback
  16. - /auth/register
  17. - /auth/tenant/list
  18. - /resource/sms/code
  19. - /*/v3/api-docs
  20. - /*/error
  21. - /csrf
  22. spring:
  23. cloud:
  24. # 网关配置
  25. gateway:
  26. # 打印请求日志(自定义)
  27. requestLog: true
  28. discovery:
  29. locator:
  30. lowerCaseServiceId: true
  31. enabled: true
  32. routes:
  33. # 认证中心
  34. - id: ruoyi-auth
  35. uri: lb://ruoyi-auth
  36. predicates:
  37. - Path=/auth/**
  38. filters:
  39. - StripPrefix=1
  40. # 代码生成
  41. - id: ruoyi-gen
  42. uri: lb://ruoyi-gen
  43. predicates:
  44. - Path=/tool/**
  45. filters:
  46. - StripPrefix=1
  47. # 系统模块
  48. - id: ruoyi-system
  49. uri: lb://ruoyi-system
  50. predicates:
  51. - Path=/system/**,/monitor/**
  52. filters:
  53. - StripPrefix=1
  54. # 资源服务
  55. - id: ruoyi-resource
  56. uri: lb://ruoyi-resource
  57. predicates:
  58. - Path=/resource/**
  59. filters:
  60. - StripPrefix=1
  61. # 演示服务
  62. - id: ruoyi-demo
  63. uri: lb://ruoyi-demo
  64. predicates:
  65. - Path=/demo/**
  66. filters:
  67. - StripPrefix=1
  68. # MQ演示服务
  69. - id: ruoyi-stream-mq
  70. uri: lb://ruoyi-stream-mq
  71. predicates:
  72. - Path=/stream-mq/**
  73. filters:
  74. - StripPrefix=1
  75. # sentinel 配置
  76. sentinel:
  77. filter:
  78. enabled: false
  79. # nacos配置持久化
  80. datasource:
  81. ds1:
  82. nacos:
  83. server-addr: ${spring.cloud.nacos.server-addr}
  84. dataId: sentinel-${spring.application.name}.json
  85. groupId: ${spring.cloud.nacos.config.group}
  86. namespace: ${spring.profiles.active}
  87. data-type: json
  88. rule-type: gw-flow