web-gateway.yml 1.3 KB

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