大家好,目前正在整合 kong 网关,使用 request-transform 插件匹配和修改 route 路径。
前端发送请求为 http://www.xxx.com/code/api/xxx/xxx/, 当经过 kong 转发到后端 service 的时候,路径应该变为 /code/api/meltSound/ 也就是说
route path: http://www.xxx.com/code/api/xxx/xxx
--- >
server path: http://www.xxx.com/code/api/meltSound/xxx/xxx
ingress 中的 route 配置为:
apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: konghq.com/strip-path: "true" ame: melt-api namespace: app spec: ingressClassName: kong rules: - host: http: paths: - path: /code/api/ pathType: Prefix backend: serviceName: network-gateway servicePort: 9527 在 request-transform 插件中设置为:
apiVersion: configuration.konghq.com/v1 kind: KongPlugin metadata: name: add-melt config: replace: uri: '/code/api/meltSound' plugin: request-transformer 目前我这个配置没有生效,所以请问下大家要如何设置?
