-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: As a user, I want to use Nginx variables in proxy-rewrite.regex_uri #13140
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Currently, proxy-rewrite supports NGINX variable resolution in uri config parameter, but not in regex_uri. See APISIX Docs | Plugins - proxy-rewrite for reference.
Examples:
-
🟢 Nginx variable resolution in
uri:proxy-rewrite: uri: /api/$arg_name
-
🟢 Pattern variable resolution in
regex_uri:proxy-rewrite: regex_uri: - ^/api/(.*)/users/(.*)$ - /v2/$1/external-users/$2
-
🔴 Nginx variable resolution in
regex_uri: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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
📋 Backlog