mikyll opened a new issue, #13140:
URL: https://github.com/apache/apisix/issues/13140

   ### Description
   
   Currently, `proxy-rewrite` supports NGINX variable resolution in `uri` 
config parameter, **but not in `regex_uri`**. See [APISIX Docs | Plugins - 
proxy-rewrite](https://apisix.apache.org/docs/apisix/plugins/proxy-rewrite/#attributes)
 for reference.
   
   Examples:
   
   - 🟢 Nginx variable resolution in `uri`:
   
       ```yaml
       proxy-rewrite:
         uri: /api/$arg_name
       ```
   
   - 🟢 Pattern variable resolution in `regex_uri`:
   
       ```yaml
       proxy-rewrite:
         regex_uri:
           - ^/api/(.*)/users/(.*)$
           - /v2/$1/external-users/$2
       ```
   
   - 🔴 Nginx variable resolution in `regex_uri`:
   
       ```yaml
       proxy-rewrite:
         regex_uri:
           - ^/api/(.*)/users/(.*)$
           - /v2/$1/external-users/$arg_name
       ```
       
       This is **not** allowed and will throw an error.
   
   ## Question
   
   Since `regex_uri` already supports variables resolution for regex patterns 
(e.g. patterns matched by `(.*)/(.*)` can be referenced with `$1` and `$2`), I 
was wondering: why does `uri` allow Nginx variables resolution, but `regex_uri` 
does not? Is this a design choice? Are there any contraindications in 
implementing this feature?
   


-- 
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