application.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. server:
  2. port: ${SERVER_PORT:8088}
  3. spring:
  4. application:
  5. name: background-gateway
  6. cloud:
  7. nacos:
  8. discovery:
  9. server-addr: ${NACOS_ADDR:106.55.99.175:8845}
  10. ip: ${NACOS_IP:127.0.0.1}
  11. username: ${NACOS_USERNAME:nacos}
  12. password: ${NACOS_PASSWORD:Nacos@123!}
  13. gateway:
  14. discovery:
  15. locator:
  16. enabled: true
  17. lower-case-service-id: true
  18. routes:
  19. # 路由id
  20. - id: gateway-user
  21. # 匹配后提供服务路由地址
  22. uri: lb://background-user
  23. # 断言
  24. predicates:
  25. - Path=/user-api/v1/**
  26. filters:
  27. - StripPrefix=1
  28. - id: test
  29. uri: https://www.baidu.com/
  30. order: 1
  31. predicates:
  32. - Path=/test-api/**
  33. filters:
  34. - StripPrefix=1
  35. # redis:
  36. # host: ${REDIS_HOST:47.93.102.223}
  37. # port: ${REDIS_PORT:16379}
  38. # password: ${REDIS_PASSWORD:1qazZAQ!2}
  39. # database: ${REDIS_DATABASE:1}
  40. # lettuce:
  41. # pool:
  42. # # 连接池中的最小空闲连接
  43. # min-idle: 1
  44. # # 连接池中的最大空闲连接
  45. # max-idle: 6
  46. # # 连接池最大连接数(使用负值表示没有限制,不要配置过大,否则可能会影响redis的性能)
  47. # max-active: 10
  48. # # 连接池最大阻塞等待时间(使用负值表示没有限制);单位毫秒
  49. # max-wait: 1000
  50. # # 关闭超时时间;单位毫秒
  51. # shutdown-timeout: 200
  52. redis:
  53. cluster:
  54. nodes: ${REDIS_NODES:81.68.234.235:6371,81.68.234.235:6372,81.68.234.235:6373,81.68.234.235:6374,81.68.234.235:6375,81.68.234.235:6376}
  55. max-redirects: ${REDIS_MAX_REDIRECTS:3}
  56. password: ${REDIS_PASSWORD:1234}
  57. lettuce:
  58. pool:
  59. max-active: ${redis.maxTotal:200}
  60. max-wait: ${redis.socketTimeout:100000}
  61. max-idle: ${redis.maxIdle:100}
  62. min-idle: ${redis.minIdle:100}