New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kong 0.11.1 evaluation order of proxy is not clear between Prefix URI and Regex URI #3111
Comments
I've found that there is a test case which describe my example https://github.com/Kong/kong/blob/master/spec/01-unit/010-router_spec.lua#L311 So maybe it is not a bug, but the documentation is not clear, and not completed. As far as I know, Kong have 3 rules:
But from the test case, rule 3 is not enough. Could you please add required rules? |
Hi, There might indeed be some lack of documentation in this case. The behavior we follow is identical to that of NGINX's
There is one crucial piece to your precise use-case that we have not yet implemented, which is the
See: https://nginx.org/en/docs/http/ngx_http_core_module.html#location In your case, you wish to define your first two endpoints with such a rule: if one of them match, short-circuit step 2 and return the plain URI as a match. This could indeed be clarified in the documentation, and this rule should eventually be implemented in the router as well. |
Thank you very much for your clarification :) |
As this stuff is now merged to docs, I will close this: We have a lot of thoughts on this, so keeping this open is not necessary. |
At this time, Kong 0.11.1 say that:
URI prefixes are always evaluated first
, but it is not clear.In #2899, @checky has raised that in issue 1
If I understand correctly
URI prefixes are always evaluated first
, following expected result should be correct:Setting
Expected result
But actual result is
Actual result
So I don't know whether it is a bug, or I mis-understand something?
The text was updated successfully, but these errors were encountered: