SpringCloud Gateway

发布时间 2023-12-20 09:29:26作者: 梅丹隆

一、依赖

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>

二、配置

spring:
  cloud:
    gateway:
      routes:
        - id: product
          uri: http://localhost:9000
          predicates:
            - Host=product.muke.com**
        - id: auth
          uri: http://localhost:5000
          predicates:
            - Path=/oauth/token
        - id: skill
          uri: http://localhost:13000
          predicates:
            - Path=/skill