有没有办法在大使使者入口中使用正则表达式删除双斜杠?

Is there a way to remove double slash using regex in ambassador emissary ingress?

我已经部署了大使边缘堆栈,并且正在使用主机和映射资源来路由我的流量。我想以这样一种方式实现映射,即如果路径中有任何双斜杠,则使用正则表达式(或任何其他可用方式)从中删除一个斜杠。 例如,如果客户端请求 https://a.test.com//testapi 我希望它是 https://a.test.com/testapi.

我搜索了大使文件,但找不到任何有用的东西。

谢谢

Module Resource使者入口。

If present, the Module defines system-wide configuration. This module can be applied to any Kubernetes service (the ambassador service itself is a common choice). You may very well not need this Module. To apply the Module to an Ambassador Service, it MUST be named ambassador, otherwise it will be ignored. To create multiple ambassador Modules in the same namespace, they should be put in the annotations of each separate Ambassador Service.

您应该将其添加到模块的 yaml 文件中:

spec:
...
  config:
...
    merge_slashes: true

If true, Emissary-ingress will merge adjacent slashes for the purpose of route matching and request filtering. For example, a request for //foo///bar will be matched to a Mapping with prefix /foo/bar.