Spring Cloud PrefixPath GatewayFilter工廠

2024-01-04 17:42 更新

PrefixPath GatewayFilter工廠采用單個(gè)prefix參數(shù)。

application.yml。 

spring:
  cloud:
    gateway:
      routes:
      - id: prefixpath_route
        uri: https://example.org
        filters:
        - PrefixPath=/mypath

這會(huì)將/mypath作為所有匹配請(qǐng)求的路徑的前綴。因此,對(duì)/hello的請(qǐng)求將被發(fā)送到/mypath/hello。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)