Unable to use query parameter (?) in path based routing

Hello,

I wanted to setup ingress with query parameter on path based routing which does not work if I usethe question mark ? in URL path.

Basically I have multiple up-streams and I want to route based on path matching string and query parameter.

I am trying to configure ingress in this way, but it does not work when I use ? in the request URL path.

spec:
  rules:
  - host: foo.example.com
    http:
      paths:
      - backend:
          serviceName: service-1
          servicePort: 8080
        path: /.*(foo).*

It works when use foo in URL path as

curl https://foo.example.com/abcfoo=bar

But it does not work if I use query parameter

curl https://foo.example.com/abc?foo=bar

It says “no Route matched with those values”

I also have tried to escape the ‘?’ as path: /.*\?(foo).*, in this case it does not match any route and always getting “no Route matched with those values”

Can you please suggest how can I get this working ? is there any plugin I can use ?

Thank you

The stock Kong router doesn’t support routing by query string. Per this issue comment there is a third-party plugin to handle it.

Have you solved this problem


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ