URL rewriting is one of the most common reasons engineers reach for a proxy. A legacy client points at the wrong route, a canary needs traffic before DNS catches up, or a third party SDK ships with a typo. changeRequestPathAction lets you fix the path in flight from a YAML rule, so the client keeps working while the real fix is being prepared.
Use changeRequestPathAction when the path the client sends needs to be rewritten before it reaches the server. The host stays the same, only the path and query string are replaced.
Typical situations include:
/api/v1/... at the new /api/v2/... routes without redeploying it.The action evaluates on requestHeaderReceivedFromClient. The whole path including the query string is replaced, so include the query in newPath if you need to keep one.
Useful when a desktop client still calls the old API. The rewrite is transparent to the client and you avoid shipping a new build.
rules:
- filter:
typeKind: FilterCollection
operation: And
children:
- typeKind: HostFilter
pattern: api.example.com
- typeKind: PathFilter
pattern: ^/v1/(.*)$
operation: Regex
actions:
- typeKind: ChangeRequestPathAction
newPath: /v2/{0}
Combine with a tight filter so only one client or environment is rerouted. The upstream sees the canary path.
rules:
- filter:
typeKind: FilterCollection
operation: And
children:
- typeKind: HostFilter
pattern: api.example.com
- typeKind: PathFilter
pattern: /search
actions:
- typeKind: ChangeRequestPathAction
newPath: /search?canary=true
The SDK calls the wrong endpoint and you cannot patch it. Rewrite the path in flight while a fix is shipped.
rules:
- filter:
typeKind: PathFilter
pattern: /broken/old-endpoint
actions:
- typeKind: ChangeRequestPathAction
newPath: /healthy/new-endpoint
Change request uri path. This action alters only the path of the request. Request path includes query string.
Evaluation scope defines the timing where this filter will be applied.
requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client
changeRequestPathAction
The following table describes the customizable properties available for this action:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| newPath | string |
The following examples apply this action to any exchanges
Change request path to /hello.
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: ChangeRequestPathAction
newPath: /hello
View definition of ChangeRequestPathAction for .NET integration.
The following actions are related to this action:
No. Only the path is rewritten. To send requests to a different host or port, combine with forwardAction or DNS tricks like spoofDnsAction.
Yes. The newPath value replaces both the path and the query string. Append a ?key=value if you need to keep query parameters.
Yes, when the filter uses regex with capture groups, you can reference them in the new path with positional placeholders like {0}.
It is untouched. Only the URI path is replaced. Headers like Host are preserved.