Request & Response Transforms
Aegis supports ordered, conditional transform rules that modify requests before they reach the upstream and responses before they are returned to the client. Transforms are configured per proxy host and executed in a user-defined sort order.
Capabilities
Transform Phases
Each rule targets either the request or response phase:Request Actions
Response Actions
Variable Expansion
Header values and URLs support${variable} placeholders that are substituted at runtime:
Conditional Execution
Every transform rule can optionally include one or more conditions using the same condition engine as Custom WAF Rules. Conditions use AND logic — all conditions must match for the transform to execute. This enables patterns like:- Set
X-Forwarded-Useronly when a valid OAuth session is present - Rewrite paths only for specific User-Agent strings
- Add CORS headers only for requests from allowed origins
- Redirect HTTP to HTTPS only for non-API paths
- Remove
Serverheader only when the response status is 2xx - Add
Cache-Controlonly whenContent-Typematches a specific pattern
Path Rewriting
Path rewriting supports two modes:Literal Replacement
Replace the first occurrence ofpath_match with path_replace:
/api/v1/users becomes /api/v2/users.
Regex Replacement
Enablepath_regex to use RE2 regex with capture groups:
/app/settings/profile becomes /dashboard/settings/profile.
Built-in Templates
The admin UI provides preset templates for common transform patterns:Execution Order
Transforms execute in sort-order sequence within each phase. The UI supports drag-to-reorder, and the API accepts an ordered list of rule IDs:redirect action fires, it short-circuits the chain — no further transforms or proxying occurs.

