Spring cloud Spring云网关-基于标头的重定向

Spring cloud Spring云网关-基于标头的重定向,spring-cloud,spring-cloud-gateway,Spring Cloud,Spring Cloud Gateway,仅使用SpringCloudGateway,我目前正在使用以下路由(在Kotlin中定义)代理远程站点: 下面的路线应该可以让您进入: - id: redirect_on_referer uri: http://localhost:8081 predicates: - Header=Referer, http://localhost:8081/proxgoo/ filters: - RewritePath=/(?<segment>.*), /proxgoo

仅使用SpringCloudGateway,我目前正在使用以下路由(在Kotlin中定义)代理远程站点:


下面的
路线
应该可以让您进入:

- id: redirect_on_referer
  uri: http://localhost:8081
  predicates:
    - Header=Referer, http://localhost:8081/proxgoo/
  filters:
    - RewritePath=/(?<segment>.*), /proxgoo/$\{segment}
-id:referer上的重定向
uri:http://localhost:8081
谓词:
-Header=Referer,http://localhost:8081/proxgoo/
过滤器:
-重写路径=/(?*),/proxgoo/$\{segment}
spring:
  cloud:
    gateway:
      routes:
      - id: redirect_on_referer
        predicates:
        - Header=Referer,http://localhost:8081/proxgoo/
        filters:
        - RedirectTo=302, http://localhost:8081/proxgoo/
- id: redirect_on_referer
  uri: http://localhost:8081
  predicates:
    - Header=Referer, http://localhost:8081/proxgoo/
  filters:
    - RewritePath=/(?<segment>.*), /proxgoo/$\{segment}