uinian.gateway-server.1.0.2.source-code.application.yml Maven / Gradle / Ivy
server:
port: 8886
eureka:
instance:
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
hostname: ${spring.cloud.client.ip-address}
client:
service-url:
defaultZone: http://eureka-server-1:8761/eureka/,http://eureka-server-2:8761/eureka/
spring:
application:
name: gateway-server
cloud:
gateway:
discovery:
locator:
enabled: true #开启从注册中心动态创建路由
# 下边的还是路由以及断言
routes:
- id: order-server #路由的id,没有固定规则,但是必须唯一,建议配合服务名使用
uri: lb://order-server
predicates:
- Path=/orderapi/**
filters:
- StripPrefix=1
- id: user-server #路由的id,没有固定规则,但是必须唯一,建议配合服务名使用
uri: lb://user-server
predicates:
- Path=/userapi/**
filters:
- StripPrefix=1