莫大人

1.3.4、通过Host匹配

server:
  port: 8080

spring: 
  application:
    name: gateway
  cloud:
    gateway:
      routes:
        - id: guo-system4
          uri: https://www.baidu.com
          predicates:
            - Path=/gateway
            - Host=**.baidu.com #通过 Header 属性匹配,当header中Host=**.baidu.com时匹配
          filters:
            - StripPrefix=1

 

posted on 2021-06-21 10:57  莫大人  阅读(56)  评论(0编辑  收藏  举报

导航