|  | @ -0,0 +1,63 @@
 | 
												
													
														
															|  | 
 |  | ##如果有配置服务的话,远程服务器和本地服务器配置不一致的情况下,优先远程的为主
 | 
												
													
														
															|  | 
 |  | server:
 | 
												
													
														
															|  | 
 |  |   port: ${server.web-gateway-port}
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | spring:
 | 
												
													
														
															|  | 
 |  |   application:
 | 
												
													
														
															|  | 
 |  |     name:  web-gateway  ##注册到发现服务的id 如果id一样 eurika会自动做负载
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |   cloud:
 | 
												
													
														
															|  | 
 |  |     config:
 | 
												
													
														
															|  | 
 |  |       enabled: false    ##是否加入配置服务
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | eureka:
 | 
												
													
														
															|  | 
 |  |   client:
 | 
												
													
														
															|  | 
 |  |     healthcheck:
 | 
												
													
														
															|  | 
 |  |       enabled: true #启动监控检查
 | 
												
													
														
															|  | 
 |  |   instance:
 | 
												
													
														
															|  | 
 |  |     #eurika使用IP不使用host
 | 
												
													
														
															|  | 
 |  |     prefer-ip-address: true
 | 
												
													
														
															|  | 
 |  |     #定制化在eurika中显示的名称
 | 
												
													
														
															|  | 
 |  |     instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | hystrix:
 | 
												
													
														
															|  | 
 |  |   metrics:
 | 
												
													
														
															|  | 
 |  |     polling-interval-ms: 20000 ##熔断间隔时间 默认是2秒 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | #zuul 默认会代理所有的微服务  路径 /{appliction.name}/**
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | zuul:
 | 
												
													
														
															|  | 
 |  |   ignored-services: '*'  ##忽略全部的代理  忽略单个微服务   ignored-services: svr-user 多个逗号分割
 | 
												
													
														
															|  | 
 |  |   routes:
 | 
												
													
														
															|  | 
 |  |     svr-user: /user/**  ##svr-user方向代理到/user下多层级的路径
 | 
												
													
														
															|  | 
 |  | #    svr-user:    这种方式和  svr-user: /user/**  一样  svr-user可以随便写 唯一即可
 | 
												
													
														
															|  | 
 |  | #      path: /user/**  path是代理后的路径
 | 
												
													
														
															|  | 
 |  | #      serviceId: svr-user  serviceId是微服务name
 | 
												
													
														
															|  | 
 |  | #   svr-user: 这种方式和 上面一样 就是serviceId改成具体的url 但是这种配置方法不能利用eurika的负载均衡
 | 
												
													
														
															|  | 
 |  | #     path: /user/**
 | 
												
													
														
															|  | 
 |  | #     url: http://localhost:10020/
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | #svr-user: 这边是微服务ID  配置负载均衡
 | 
												
													
														
															|  | 
 |  | #  ribbon:
 | 
												
													
														
															|  | 
 |  | #    listOfService: http://localhost:10020/,http://localhost:10021/
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | ---
 | 
												
													
														
															|  | 
 |  | spring:
 | 
												
													
														
															|  | 
 |  |   profiles: dev
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | ---
 | 
												
													
														
															|  | 
 |  | spring:
 | 
												
													
														
															|  | 
 |  |   profiles: test
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | ---
 | 
												
													
														
															|  | 
 |  | spring:
 | 
												
													
														
															|  | 
 |  |   profiles: prod
 |