Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/envoy/api/v2/route/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,33 @@ message RouteAction {
// requests to */prefix/etc* will be stripped to */etc*.
string prefix_rewrite = 5;

// Indicates that during forwarding, paths that match the pattern should be
// rewritten, interpolating capture groups from the path pattern into the new path as specified
// by the rewrite pattern. This option allows application URLs to be rewritten at the reverse
// proxy layer in a way that is aware of segments with variable contents like IDs. The router
// filter will place the original path before rewrite into the :ref:`x-envoy-original-path //
// <config_http_filters_router_x-envoy-original-path>` header. Examples:
//
// * The path pattern *^/foo/(bar)/(.*)$ paired with rewrite pattern */$1/$2* would transform
// */foo/bar/baz/bang* into */bar/baz/bang*.
//
// [#next-major-version: RegexRewrite should be merged with prefix_rewrite and converted to a
// oneof.]
RegexRewrite regex_rewrite = 30;

message RegexRewrite {
// Represents a regular expression that the path must match in order for the substitution
// to be applied. The regular expression may include capture groups to be interpolated into the
// substitution.
string pattern = 1;

// Represents the substitution used to build the final path of the request if the initial path
// matches
// the pattern. The substitution may include references to capture groups defined in the
// pattern which will be interpolated into the final path.
string substitution = 2;
}

oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
Expand Down
1 change: 1 addition & 0 deletions docs/root/configuration/operations/tools/router_check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ expects a cluster name match of "instant-server".::
virtual_host_name: ...,
host_rewrite: ...,
path_rewrite: ...,
regex_rewrite: ...,
path_redirect: ...,
- header_fields:
key: ...,
Expand Down
Loading