Redirects and Static Responses
Return redirects or fixed local responses without forwarding the request to an upstream service.
Use This When
Use redirects for host/path migrations. Use static responses for maintenance pages, health probes, or deliberate sink routes.
Prerequisites
- A listener that receives the public request.
- A Site assigned to the listener, with the intended hostnames, and a clear path match.
Steps
To redirect a whole host, open Proxy -> Sites and create a draft site for
old.example.comonpublic-https. Inside the site workspace, select Add first route and configure:Field Value Priority 10Path prefix /Action Redirect Mode External origin Target https://new.example.comStatus 308Preserve path suffix On Preserve query On Save the route, configure HTTPS certificate coverage for the site, and publish it. This sends:
texthttps://old.example.com/docs?a=1 -> https://new.example.com/docs?a=1
The route drawer keeps redirect mode, target, status code, path-suffix preservation, and query handling with the match that triggers it. To redirect a path on the same host, open the site for
app.example.com, add a route, and use same-host path mode:Field Value Path prefix /oldMode Same host path Target /newStatus 302To serve a static maintenance response, open its site under Proxy -> Sites, select the route's Edit action, then select Add target and configure a static target:
Field Value Name maintenanceType Static Status 503Body Maintenance in progressEnabled On Expand Advanced target settings to select a reusable Generic body template or add response headers such as
Content-TypeandRetry-After. Create reusable bodies under Templates, then select one in the route drawer.
A static target returns directly from p2pstream. The visible route drawer controls its status and inline body for deliberate local responses such as maintenance pages, probes, or temporary sink routes. 
Generic response templates centralize reusable bodies for static targets, rate-limit responses, and WAF block responses while each caller keeps control of status and headers. Give that route a lower priority number than the normal app route in the same site:
Field Value Priority 1Path prefix /Target maintenance
Verification
Run:
curl -I https://old.example.com/docs?a=1
curl -i https://app.example.com/Redirect routes should return 301, 302, 307, or 308. Static routes should return the configured status, body, and headers.
Troubleshooting
| Symptom | Check |
|---|---|
| Redirect target rejected | Same-host targets must be root-relative paths; external-origin targets must be HTTP/HTTPS origins. |
| Wrong route wins | Lower priority numbers run first. |
| Static route affects unintended paths | Narrow the route's path match inside its site or disable the route after maintenance. |
| Template rejected | Static targets can only use generic body templates. |