-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
request_path match order #2242
Comments
I searched keyword 'request_path' on the github repo but I couldn't find the source code of the matching process. I would be grateful if you can share the code so that I can see the process. |
This PR #1970 documents the way the selection is done for versions >= 0.10.0. Also documentation around this can be found here: https://getkong.org/docs/0.10.x/proxy/#routing-priorities |
Thank you. I'm reading it now. |
It seems my understanding is correct. And I think that combining request_path and request_host became possible from version 0.10. Awesome. #845 |
before 0.10 the paths would be matched longest to shortest. So you are correct. In 0.10 it was rewritten, haven't checked, but assume that it still works the same way. In general: the more specific match has a higher precedence |
I have some api endpoints and I want enable plugin on specific endpoint. I'm wondering how request_path matching works.
Take for the following example, I have two api settings; "api-item" and "api-all". I want to setup hmac plugin for only "api-item".
After testing, it worked as my expectation. I think request_path priorities longer match. Is this my understanding correct?
The text was updated successfully, but these errors were encountered: