Request URI Actions
OpenResty Edge provides the following actions to modify the URI of client requests.
Set URI
Two actions are set in this page rule, one is “Set URI”, this action has only one parameter “URI”, just enter the new URI here, the new URI needs to start with /
.
The purpose of the other action “Use Edgelang” is to print the modified URI.
Example:
$ curl test.com/old
/new
Add URI prefix
This action has only one parameter “Value”, just enter the URI prefix that needs to be added here, and the URI prefix needs to start with /
.
Example:
$ curl test.com/a
/prefix/a
Remove the URI prefix
This action has only one parameter “Value”, just enter the URI prefix that needs to be removed here, and the URI prefix needs to start with /
.
Example:
$ curl test.com/prefix/a
/a
Delete URI fragment
This action has only one parameter “Segment Index” and takes values starting from 1. When a segment with the specified index does not exist for the URI, it will not be removed.
Example:
$ curl test.com/a/b/c
/a/c
$ curl test.com/a
/a