Execution order of regex uris

Hi,

We are in the process of migrating our API gateway to Kong, and encountered a major road block.

We noticed this section from the docs: “However, Kong will evaluate regex URIs based on the order in which they are defined. This means that considering the following APIs”, which really makes Kong unmaintainable for us.

Is there a reason why the regex uris evaluation order behaves differently than non regex uris ?

We spotted this discussion (https://groups.google.com/forum/#!topic/konglayer/sR9j-yDEjLc), which mentioned a potential fix in 0.12 version, is that still the case?

Appreciate any help! Thanks!

Hi,

We have plans to introduce a priority field when considering the matching order of the Regex URIs (comparatively to NGINX and its static configuration file in which users can enforce some ordering, our RESTful APIs makes this task trickier). However, it is a known limitation that as of today, the order of creation is the criteria in use.

While this fix was originally planned for 0.12 as previously communicated, the scope of 0.12 shifted as the end of 2017 approached to only include health checks and circuit breakers, so that any data modeling work has been pushed back to 0.13, for which we have no release date yet.

Regexes cannot really be compared by length, well they could, but that feels a bit artificial. With prefix matching it makes sense to match the longest (more specific) one first. E.g. /[.]* matches everything, but is longer than more specific /a+

1 Like