拓恒统一网关服务
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

149 lines
5.1KB

  1. spring:
  2. security:
  3. oauth2:
  4. resource-server:
  5. jwt:
  6. issuer-uri: http://127.0.0.1:8090
  7. cloud:
  8. consul:
  9. host: 127.0.0.1 # 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: 127.0.0.1
  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. # 使用lb协议,tuoheng-auth是服务名
  51. uri: lb://tuoheng-auth
  52. # 断言
  53. predicates:
  54. - Path=/api/auth/**
  55. # 去掉前缀前两级
  56. filters:
  57. - StripPrefix=2
  58. # 系统模块
  59. - id: tuoheng-dsp-system
  60. uri: lb://tuoheng-dsp-system
  61. predicates:
  62. - Path=/api/system/**
  63. filters:
  64. - StripPrefix=2
  65. # 代码生成器
  66. - id: tuoheng-generator
  67. uri: lb://tuoheng-generator
  68. predicates:
  69. - Path=/api/generator/**
  70. filters:
  71. - StripPrefix=2
  72. # 后台管理
  73. - id: tuoheng-admin
  74. uri: lb://tuoheng-admin
  75. predicates:
  76. - Path=/api/admin/**
  77. filters:
  78. - StripPrefix=2
  79. # - name: Hystrix
  80. # args:
  81. # name: fallbackcmd
  82. # fallbackUri: forward:/fallback
  83. # 网站服务
  84. - id: tuoheng-portal
  85. uri: lb://tuoheng-portal
  86. predicates:
  87. - Path=/api/portal/**
  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