web-gateway.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ##如果有配置服务的话,远程服务器和本地服务器配置不一致的情况下,优先远程的为主
  2. server:
  3. port: ${server.web-gateway-port}
  4. eureka:
  5. client:
  6. healthcheck:
  7. enabled: true #启动监控检查
  8. instance:
  9. #eurika使用IP不使用host
  10. prefer-ip-address: true
  11. #定制化在eurika中显示的名称
  12. instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
  13. #zuul 默认会代理所有的微服务 路径 /{appliction.name}/**
  14. zuul:
  15. # ignored-services: '*' ##忽略全部的代理 忽略单个微服务 ignored-services: svr-user 多个逗号分割
  16. routes:
  17. svr-user: /user/** ##svr-user方向代理到/user下多层级的路径
  18. # svr-user: 这种方式和 svr-user: /user/** 一样 svr-user可以随便写 唯一即可
  19. # path: /user/** path是代理后的路径
  20. # serviceId: svr-user serviceId是微服务name
  21. # svr-user: 这种方式和 上面一样 就是serviceId改成具体的url 但是这种配置方法不能利用eurika的负载均衡
  22. # path: /user/**
  23. # url: http://localhost:10020/
  24. #svr-user: 这边是微服务ID 配置负载均衡
  25. # ribbon:
  26. # listOfService: http://localhost:10020/,http://localhost:10021/
  27. ---
  28. spring:
  29. profiles: jwdev
  30. zipkin:
  31. base-url: 127.0.0.1:${server.svr-logServer-port} #日志追踪的地址
  32. sleuth:
  33. sampler:
  34. percentage: 1.0 ##采用需要的请求的百分比 默认是0.1 即 10%
  35. ---
  36. spring:
  37. profiles: jwtest
  38. zipkin:
  39. base-url: localhost:${server.svr-logServer-port} #日志追踪的地址
  40. sleuth:
  41. sampler:
  42. percentage: 1.0 ##采用需要的请求的百分比 默认是0.1 即 10%
  43. ---
  44. spring:
  45. profiles: jwprod
  46. zipkin:
  47. base-url: localhost:${server.svr-logServer-port} #日志追踪的地址
  48. sleuth:
  49. sampler:
  50. percentage: 1.0 ##采用需要的请求的百分比 默认是0.1 即 10%