Rewrite rules transparently redirect matching requests to a different URL before forwarding them. The client never sees the rewrite — it receives a response from the rewritten destination as if it had called the original URL.
Common uses: point a mobile app at a staging server, reroute a specific API path to a local service, or swap a version prefix without touching the client.
apxy rewrite
Create and manage request URL rewrite rules for the running proxy
Options
-h, --help help for rewriteOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - HTTPS proxy for capturing, inspecting, and modifying API traffic
- apxy rewrite disable - Disable a rewrite rule
- apxy rewrite edit - Edit a rewrite rule
- apxy rewrite enable - Enable a rewrite rule
- apxy rewrite list - List rewrite rules
- apxy rewrite remove - Remove a rewrite rule by ID or all rewrite rules
- apxy rewrite set - Add a rewrite rule that rewrites matching request URLs
apxy rewrite disable
Disable a rewrite rule
Synopsis
Disable a rewrite rule without removing it, or disable all rewrite rules with —all. Disabled rules are ignored during matching.
Either —id or —all is required. Use “apxy rewrite list” to find rule IDs.
apxy rewrite disable [flags]Examples
apxy rewrite disable --id abc123
apxy rewrite disable --allOptions
--all apply to all resources
--control-url string control API URL (default "http://127.0.0.1:8081")
--dry-run preview what would happen without executing
-h, --help help for disable
--id string rewrite rule IDOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy
apxy rewrite edit
Edit a rewrite rule
Synopsis
Edit an existing rewrite rule. Only the flags you supply are updated; all other fields remain unchanged.
Flags: —name rule name for identification —from source URL pattern to match —to destination URL to rewrite to —match match type: exact, wildcard, or regex
apxy rewrite edit <id> [flags]Examples
apxy rewrite edit abc123 --to "https://staging.example.com"
apxy rewrite edit abc123 --from "https://api.example.com/v2/*" --match wildcardOptions
--control-url string control API URL (default "http://127.0.0.1:8081")
--from string source URL pattern
-h, --help help for edit
--match string match type: exact|wildcard|regex
--name string rule name
--to string destination URLOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy
apxy rewrite enable
Enable a rewrite rule
Synopsis
Re-enable a previously disabled rewrite rule by its unique ID, or enable all rewrite rules with —all.
Either —id or —all is required. Use “apxy rewrite list” to find rule IDs.
apxy rewrite enable [flags]Examples
apxy rewrite enable --id abc123
apxy rewrite enable --allOptions
--all apply to all resources
--control-url string control API URL (default "http://127.0.0.1:8081")
--dry-run preview what would happen without executing
-h, --help help for enable
--id string rewrite rule IDOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy
apxy rewrite list
List rewrite rules
Synopsis
List all configured rewrite rules, including their IDs, names, source/destination patterns, and match types.
Flags: —format output format: json or toon (default: json)
apxy rewrite list [flags]Examples
apxy rewrite list
apxy rewrite list --format toonOptions
--control-url string control API URL (default "http://127.0.0.1:8081")
--format string output format: json|toon (default "json")
-h, --help help for list
-q, --quiet output only IDs, one per lineOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy
apxy rewrite remove
Remove a rewrite rule by ID or all rewrite rules
Synopsis
Remove a rewrite rule by its unique ID, or remove all rewrite rules with —all.
Either —id or —all is required. Use “apxy rewrite list” to find rule IDs.
apxy rewrite remove [flags]Examples
apxy rewrite remove --id abc123
apxy rewrite remove --allOptions
--all apply to all resources
--control-url string control API URL (default "http://127.0.0.1:8081")
--dry-run preview what would happen without executing
-h, --help help for remove
--id string rewrite rule IDOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy
apxy rewrite set
Add a rewrite rule that rewrites matching request URLs
Synopsis
Add a rewrite rule that rewrites the URL of matching requests before forwarding.
Flags: —name rule name for identification —from source URL pattern to match —to destination URL to rewrite to —match match type: exact, wildcard, or regex (default: exact)
apxy rewrite set [flags]Examples
apxy rewrite set --name "staging" --from "https://api.example.com" --to "https://staging.example.com" --match exact
apxy rewrite set --name "v2-api" --from "https://api.example.com/v1/*" --to "https://api.example.com/v2/*" --match wildcardOptions
--control-url string control API URL (default "http://127.0.0.1:8081")
--from string source URL pattern
-h, --help help for set
--match string match type: exact|wildcard|regex (default "exact")
--name string rule name
--to string destination URLOptions inherited from parent commands
--config string config file (default is ./configs/default.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy rewrite - Create and manage request URL rewrite rules for the running proxy