Closed hozaifaaoud closed 2 years ago
Hey @hozaifaaoud have you tried it by adding route path as you stated.
Yes, and I am facing this issue
@starsz, @nic-chen, @imjoey, @juzhiyuan have a look here. Thank you
Add vars in uri is not support.
But you can try to use var filed in route. refer: https://github.com/apache/apisix/blob/master/docs/en/latest/admin-api.md#route
Like this:
"vars": [["uri", "~~", "{your regex}"]],
Hi @hozaifaaoud , have our answers solved your problem? If not, please update more details, or we consider the problem solved and will close it after three days, thanks a lot
please refer to:
https://github.com/apache/apisix/blob/master/docs/en/latest/router-radixtree.md#5-parameter-match
https://github.com/api7/lua-resty-radixtree/#parameters-in-path
@starsz @nic-chen @liuxiran
Hi all, according to the docs, the parameter radixtree_uri_with_parameter
allows users to set /blog/:name
as the uri which could match /blog/dog
and /blog/:cat
. I was wondering that if we can also use it in regex_uri
? For example, if regex_uri
is set to [" /iresty/:p1/:p2/:p3", "/x:p1/y:p2/z:p3"]
, apisix could match request with /iresty/name/age/gender
and rewrite the request url to /xname/yage/zgender
and then send to the upstreams.
Looking forward to your feedbacks. Thanks.
please refer to: https://github.com/apache/apisix/blob/master/docs/en/latest/router-radixtree.md#5-parameter-match https://github.com/api7/lua-resty-radixtree/#parameters-in-path
@starsz @nic-chen @liuxiran
Hi all, according to the docs, the parameter
radixtree_uri_with_parameter
allows users to set/blog/:name
as the uri which could match/blog/dog
and/blog/:cat
. I was wondering that if we can also use it inregex_uri
? For example, ifregex_uri
is set to[" /iresty/:p1/:p2/:p3", "/x:p1/y:p2/z:p3"]
, apisix could match request with/iresty/name/age/gender
and rewrite the request url to/xname/yage/zgender
and then send to the upstreams.Looking forward to your feedbacks. Thanks.
also cc @spacewander to help take a look, thanks a lot
radixtree_uri_with_parameter is disabled by default. And it has a design defect: ':' is a valid character in the URL, so it is not recommended to enable it.
radixtree_uri_with_parameter is disabled by default. And it has a design defect: ':' is a valid character in the URL, so it is not recommended to enable it.
thanks for @spacewander 's reply, also cc @imjoey @hozaifaaoud to kown.
As vars in url is helpful for some users, I wonder if we have plan to Improve this feature?
radixtree_uri_with_parameter is disabled by default. And it has a design defect: ':' is a valid character in the URL, so it is not recommended to enable it.
thanks for @spacewander 's reply, also cc @imjoey @hozaifaaoud to kown.
As vars in url is helpful for some users, I wonder if we have plan to Improve this feature?
That would be great. Uses could use these vars to design complicated route match rules, as well as request parameter rewrite.
This issue has been marked as stale due to 30 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
any good news
AFAIK, no plan to support this, but PR is welcome.
This issue has been marked as stale due to 30 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.
How can I add vars in uri? And how can I create a route like this Http://127.0.0.1:9080/tel/{TelNum}/email/{EmailAdd}