qwzhou89 commented on issue #9818:
URL: https://github.com/apache/apisix/issues/9818#issuecomment-1634005763

   > code sample(not test yet):
   > 
   > ```
   > local core = require("apisix.core");
   > local b64 = require("ngx.base64");
   > local splited_uris = core.utils.split_uri(ctx.var.upstream_uri);
   > ctx.var.upstream_uri = table.concat(splited_uris,"", 1, #splited_uris - 1) 
.. b64.encode_base64url(splited_uris[#splited_uris]);
   > ```
   
   这应该是可以的。另外也可以参考
   apisix/plugins/proxy-rewrite.lua
   的代码,把`proxy-rewrite`的`regex_uri`的逻辑在serverless-pre-function里面实现下也可以。
   
   
还有,不知道你使用的apisix版本是多少,2.15.3以上的话,应该可以更改插件的优先级,把serverless-pre-function放在"phase":
 "rewrite",并把他的优先级提高,让它先于proxy-rewrite执行,应该也可以


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to