拓恒统一网关服务
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.

149 lines
5.1KB

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