【问题标题】:I want to rewrite URI in VirtualService for from regex to regex我想在 VirtualService 中重写 URI 从 regex 到 regex
【发布时间】:2020-05-30 06:45:44
【问题描述】:

我想运行以下 API。虽然我想运行以下脚本。但我无法获得预期的输出。

 - match:
      uri:
        regex: \/test\/pune/\/(.+)\/bk
   rewrite:
      uri: \/pune/\/(.+)\/bk
    route:
    - destination:
        host: yerwada
        port:
          number: 8080

但我得到以下输出 -

{"level":50,"time":1581684841254,"pid":18,"hostname":"test-ob-scheduled-payments-7cfb6779b8-x6f9b","err":{"type":"错误","消息":"解析 错误","堆栈":"错误:解析 错误","bytesParsed":4,"code":"HPE_INVALID_URL","rawPacket":{"type":"Buffer","data":[71,69,84,32,92,47,99,100,115,45 ,97,117,92,47,118,49,92,47,98]}},"v":1}

【问题讨论】:

    标签: kubernetes routing kubernetes-ingress istio gateway


    【解决方案1】:

    HttpRewrite 不能使用正则表达式,它只能接受字符串值。

    【讨论】:

    • 我怀疑还有其他方法。您需要根据文档提供准确的 URL。
    猜你喜欢
    • 2018-07-13
    • 2020-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-29
    相关资源
    最近更新 更多