url_rewrite
Rewrites request URLs using regex substitution and query parameter manipulation before the request reaches upstream.
On this page
Rewrites request URLs using regex substitution and query parameter manipulation before the request reaches upstream.
Configuration Notes
Operations are applied in declaration order, allowing complex multi-step transformations.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
operations | OperationConfig[] | no | Ordered list of rewrite operations to apply. |
operations[].regex_replace | any | no | Regex-based path replacement. |
operations[].strip_query_params | any | no | Remove named query parameters. |
operations[].add_query_params | any | no | Append query parameters. |
allow_rewrite_override | bool | no | When true, suppresses the duplicate-rewrite validation error if another rewrite filter precedes this one. |
Example
filter: url_rewrite
operations:
- regex_replace:
pattern: "^/api/v1/(.*)"
replacement: "/api/v2/$1"
- strip_query_params:
- debug
- add_query_params:
source: gateway