videni
June 12, 2018, 3:08am
1
I need to get current API uri, a uri can have dynamic segments, when a request is made to /test/1/hello
, I need to get /test/(.+)/hello
instead of /test/1/hello
, anyway to do this please?
Hi,
Yes, see the second part of this post:
Hi,
As of 0.11.0, and as documented in the Changelog and Upgrade path of that version, the way to update the upstream URL is via the $upstream_uri NGINX variable, accessible in the Lua-land as ngx.var.upstream_uri.
The upstream URI is now determined via the Nginx $upstream_uri variable. Custom plugins using the ngx.req.set_uri() API will not be taken into consideration anymore. One must now set the ngx.var.upstream_uri variable from the Lua land. #2519
Additionally, you can access the ngx.c…
About using the ngx.ctx.router_matches
structure.
Best,
1 Like
videni
June 12, 2018, 6:14am
3
great, thank you very much