Uris containing?

Hi,

I have some urls in my application which contain ? like this:

https://test.com/?events/eventDetails/101
etc.

How to configure this in Kong ?
I tried using
"uris": ["/?events"]
“uris”: ["/%3fevents"]
but they don’t work and Kong returns “no API found with those values”.

Hello,

The ? character has a special meaning in the URI standard, as it separates the path from its query. Details here: https://tools.ietf.org/html/rfc3986#section-3.3

In your example, events/eventDetails/101 is not part of the path, but the query.

Kong is only able to route queries via their path, but not their query. The easiest way of solving this problem is changing the urls of your app so they use ? for queries, not for paths. This will not only make them work correctly with Kong; if you want to interact with other apps you will likely experience similar issues.

1 Like