拓恒统一网关服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
4.8KB

  1. spring:
  2. cloud:
  3. consul:
  4. host: 172.16.1.31 # consul 所在服务地址
  5. port: 8500 # consul 服务端口
  6. discovery:
  7. enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
  8. register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
  9. deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
  10. ## consul ip地址
  11. hostname: 172.16.1.31
  12. # 注册到consul的服务名称
  13. service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
  14. instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
  15. heartbeat:
  16. enabled: true
  17. prefer-ip-address: true #表示注册时使用IP而不是hostname
  18. health-check-path: /actuator/health #健康检查
  19. health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
  20. health-check-timeout: 10s #健康检查超时
  21. gateway:
  22. discovery:
  23. locator:
  24. lowerCaseServiceId: true
  25. enabled: true
  26. # 跨域设置
  27. globalcors:
  28. add-to-simple-url-handler-mapping: true
  29. cors-configurations:
  30. '[/**]':
  31. allowedOrigins:
  32. - "http://localhost:8001"
  33. allowedMethods:
  34. - "GET"
  35. - "POST"
  36. - "DELETE"
  37. - "PUT"
  38. - "OPTIONS"
  39. allowedHeaders: "*"
  40. allowCredentials: true
  41. maxAge: 360000
  42. routes:
  43. # 认证中心
  44. - id: tuoheng-auth
  45. uri: lb://tuoheng-auth
  46. predicates:
  47. - Path=/api/auth/**
  48. filters:
  49. - StripPrefix=2
  50. # 系统模块
  51. - id: tuoheng-dsp-system
  52. uri: lb://tuoheng-dsp-system
  53. predicates:
  54. - Path=/api/system/**
  55. filters:
  56. - StripPrefix=2
  57. # 代码生成器
  58. - id: tuoheng-generator
  59. uri: lb://tuoheng-generator
  60. predicates:
  61. - Path=/api/generator/**
  62. filters:
  63. - StripPrefix=2
  64. # 后台管理
  65. - id: tuoheng-dsp-admin
  66. uri: lb://tuoheng-dsp-admin
  67. predicates:
  68. - Path=/api/admin/**
  69. filters:
  70. - StripPrefix=2
  71. # 网站服务
  72. - id: tuoheng-dsp-portal
  73. uri: lb://tuoheng-dsp-portal
  74. predicates:
  75. - Path=/api/portal/**
  76. filters:
  77. - StripPrefix=2
  78. # DSP小程序服务
  79. - id: tuoheng-dsp-miniprogram
  80. uri: lb://tuoheng-dsp-miniprogram
  81. predicates:
  82. - Path=/api/miniprogram/**
  83. filters:
  84. - StripPrefix=2
  85. # DSP api服务
  86. - id: tuoheng-dsp-api
  87. uri: lb://tuoheng-dsp-api
  88. predicates:
  89. - Path=/api/web/**
  90. filters:
  91. - StripPrefix=2
  92. # pilot后台管理
  93. - id: tuoheng-pilot-admin
  94. uri: lb://tuoheng-pilot-admin
  95. predicates:
  96. - Path=/pilot/admin/**
  97. filters:
  98. - StripPrefix=2
  99. # pilot小程序服务
  100. - id: tuoheng-pilot-miniprogram
  101. uri: lb://tuoheng-pilot-miniprogram
  102. predicates:
  103. - Path=/pilot/miniprogram/**
  104. filters:
  105. - StripPrefix=2
  106. # pilot api服务
  107. - id: tuoheng-pilot-api
  108. uri: lb://tuoheng-pilot-api
  109. predicates:
  110. - Path=/pilot/web/**
  111. filters:
  112. - StripPrefix=2
  113. # Redis数据源
  114. redis:
  115. # 缓存库默认索引0
  116. database: 0
  117. # Redis服务器地址
  118. host: r-uf6r5lm7c7sfdv3ehb.redis.rds.aliyuncs.com
  119. # Redis服务器连接端口
  120. port: 6379
  121. # Redis服务器连接密码(默认为空)
  122. password:
  123. # 连接超时时间(毫秒)
  124. timeout: 6000
  125. # 默认的数据过期时间,主要用于shiro权限管理
  126. expire: 2592000
  127. jedis:
  128. pool:
  129. max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
  130. max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
  131. max-idle: 10 # 连接池中的最大空闲连接
  132. min-idle: 1 # 连接池中的最小空闲连接
  133. #security放行白名单配置
  134. security:
  135. ignore:
  136. permitUrls: /api/system/demo/msg
  137. oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList