nexo-gateway.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # 安全配置
  2. security:
  3. # 验证码
  4. captcha:
  5. # 是否开启验证码
  6. enabled: true
  7. # 验证码类型 math 数组计算 char 字符验证
  8. type: char
  9. # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
  10. category: CIRCLE
  11. # 数字验证码位数
  12. numberLength: 1
  13. # 字符验证码长度
  14. charLength: 4
  15. # 防止XSS攻击
  16. xss:
  17. enabled: true
  18. excludeUrls:
  19. - /system/notice
  20. # 不校验白名单
  21. ignore:
  22. whites:
  23. - /code
  24. - /auth/logout
  25. - /auth/login
  26. - /auth/smsLogin
  27. - /auth/xcxLogin
  28. - /auth/register
  29. - /resource/sms/code
  30. - /*/v3/api-docs
  31. - /csrf
  32. spring:
  33. cloud:
  34. # 网关配置
  35. gateway:
  36. # 打印请求日志(自定义)
  37. requestLog: true
  38. discovery:
  39. locator:
  40. lowerCaseServiceId: true
  41. enabled: true
  42. routes:
  43. # 认证中心
  44. - id: nexo-auth
  45. uri: lb://nexo-auth
  46. predicates:
  47. - Path=/auth/**
  48. filters:
  49. # 验证码处理
  50. - ValidateCodeFilter
  51. - StripPrefix=1
  52. # 代码生成
  53. - id: nexo-gen
  54. uri: lb://nexo-gen
  55. predicates:
  56. - Path=/code/**
  57. filters:
  58. - StripPrefix=1
  59. # 系统模块
  60. - id: nexo-system
  61. uri: lb://nexo-system
  62. predicates:
  63. - Path=/system/**
  64. filters:
  65. - StripPrefix=1
  66. # 资源服务
  67. - id: nexo-resource
  68. uri: lb://nexo-resource
  69. predicates:
  70. - Path=/resource/**
  71. filters:
  72. - StripPrefix=1
  73. # 演示服务
  74. - id: nexo-demo
  75. uri: lb://nexo-demo
  76. predicates:
  77. - Path=/demo/**
  78. filters:
  79. - StripPrefix=1
  80. # MQ演示服务
  81. - id: nexo-stream-mq
  82. uri: lb://nexo-stream-mq
  83. predicates:
  84. - Path=/stream-mq/**
  85. filters:
  86. - StripPrefix=1
  87. # sentinel 配置
  88. sentinel:
  89. filter:
  90. enabled: false
  91. # nacos配置持久化
  92. datasource:
  93. ds1:
  94. nacos:
  95. server-addr: ${spring.cloud.nacos.server-addr}
  96. dataId: sentinel-${spring.application.name}.json
  97. groupId: ${spring.cloud.nacos.config.group}
  98. namespace: ${spring.profiles.active}
  99. data-type: json
  100. rule-type: gw-flow