【问题标题】:Kong Regex for Replacing String in URIKong Regex 用于替换 URI 中的字符串
【发布时间】:2021-08-25 14:50:51
【问题描述】:

我在使用“strip_path”功能时遇到了一个特殊问题

**Service Name**: application-svc
**Service Path**: /application

**Route for Service**: application-route
**Route Path**: /
**Strip_Path**: True

**Backend API**: /openapi

**Expected**:
calls made to www.xyz.com/applications/openapi will transform the url
from:  www.xyz.com/applications/openapi
to: www.xyz.com/openapi

**Actual Result**:
calls made to www.xyz.com/applications/openapi end up with  www.xyz.com/applicationsapplications/openapi

有人可以帮忙吗?

【问题讨论】:

    标签: kong kong-plugin kong-ingress konga


    【解决方案1】:

    Strip_Path 与 Route Path 相关,而不是 Route 和 Service Path。

    要解决您的问题,请使用以下方法:

    **Service Name**: application-svc
    **Service Path**: 
    
    **Route for Service**: application-route
    **Route Path**: /applications
    **Strip_Path**: True
    
    **Backend API**: /openapi
    
    **Expected**:
    calls made to www.xyz.com/applications/openapi will transform the url
    from:  www.xyz.com/applications/openapi
    to: www.xyz.com/openapi
    
    **Actual Result**:
    calls made to www.xyz.com/applications/openapi end up with
    www.xyz.com/openapi
    

    【讨论】:

      猜你喜欢
      • 2013-05-11
      • 1970-01-01
      • 2014-04-19
      • 2019-04-30
      • 1970-01-01
      • 2015-04-17
      • 1970-01-01
      • 1970-01-01
      • 2020-09-21
      相关资源
      最近更新 更多