You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/10 16:21:24 UTC

[GitHub] [apisix] gracekk opened a new issue #6571: request help:

gracekk opened a new issue #6571:
URL: https://github.com/apache/apisix/issues/6571


   ### Issue description
   
   Can proxy-rewrite or some plugin can rewrite uri from request parameter?
   e.g.  
   original request like https://abc.com/getuser?id=123
   and I want query upstream uri like  https://abc.com/123/getuser
   Any ideas?thx
   
   
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nfrankel commented on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
nfrankel commented on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064549050


   Indeed. You can use the `regex_uri` configuration parameter. In your case, its value would be something like this:
   
   ```
   ["https:\/\/abc\.com\/(.*)\?id=(.*)", "https://abc.com/getuser/$2/$1"]
   ```
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] syzygyyy commented on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
syzygyyy commented on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064688510


   Thanks for reply, it's also applies to change the parameter key?
   For example I want to change getuser interface to getdetail.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] syzygyyy edited a comment on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
syzygyyy edited a comment on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064688510


   Thanks for replay. It's also applies to change the parameter key?
   For example I want to change id parameter to userid.
   Such like https://up-stream.abc.com/getuser?userid=123


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] syzygyyy edited a comment on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
syzygyyy edited a comment on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064688510


   Thanks for reply, it's also applies to change the parameter key?
   For example I want to change id parameter to userid.
   Such like https://up-stream.abc.com/getuser?userid=123
   Like https://docs.konghq.com/hub/kong-inc/request-transformer/


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] syzygyyy edited a comment on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
syzygyyy edited a comment on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064688510


   Thanks for reply, it's also applies to change the parameter key?
   For example I want to change id parameter to userid.
   Like https://docs.konghq.com/hub/kong-inc/request-transformer/


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] syzygyyy edited a comment on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
syzygyyy edited a comment on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064688510


   It's also applies to change the parameter key?
   For example I want to change id parameter to userid.
   Such like https://up-stream.abc.com/getuser?userid=123
   Like https://docs.konghq.com/hub/kong-inc/request-transformer/


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nfrankel commented on issue #6571: request help:

Posted by GitBox <gi...@apache.org>.
nfrankel commented on issue #6571:
URL: https://github.com/apache/apisix/issues/6571#issuecomment-1064813309


   @syzygyyy I'm not sure I understand the question. However, you can transform anything you'd like as the plugin uses [regular expressions](https://en.wikipedia.org/wiki/Regular_expression).
   
   Hint: I'm not an expert, hence I usually try them [online](https://regex101.com/).


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org