Salta ai contenuti
Aa

Missing and retired resources

Questi contenuti non sono ancora disponibili nella tua lingua.

Choose 404 when an address is unknown and 410 when a resource was deliberately retired. These direct response routes produce the page at the edge without asking the application to generate it.

StatusMeaningExample message
404The requested resource is not found; the status does not say whether this is permanent.Resource not found
410The resource is intentionally gone and its removal is expected to be permanent.Resource retired

Visitor message: Resource not found

The direct route selects exactly /demo/missing and sets 404 with the encoded page. Pair it with the matching body mapping shown below.

{
"spec": {
"routes": [
{
"direct_response_route": {
"path": {
"path": "/demo/missing"
},
"http_method": "ANY",
"route_direct_response": {
"response_code": 404,
"response_body_encoded": "string:///PCFkb2N0eXBlIGh0bWw+PGh0bWwgbGFuZz0iZW4iPjxoZWFkPjxtZXRhIGNoYXJzZXQ9InV0Zi04Ij48bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoIj48dGl0bGU+UmVzb3VyY2Ugbm90IGZvdW5kPC90aXRsZT48c3R5bGU+Ym9keXttYXJnaW46MDtiYWNrZ3JvdW5kOiMwNzFiMzM7Y29sb3I6I2ZmZjtmb250OjE4cHggc3lzdGVtLXVpfW1haW57bWF4LXdpZHRoOjQycmVtO21hcmdpbjoxMnZoIGF1dG87cGFkZGluZzoycmVtfS5icmFuZHtjb2xvcjojZmY1ZjY0O2ZvbnQtd2VpZ2h0OjcwMH1oMXtmb250LXNpemU6Y2xhbXAoMnJlbSw2dncsMy41cmVtKX1we2xpbmUtaGVpZ2h0OjEuNn1he2NvbG9yOiM5Y2RkZmZ9PC9zdHlsZT48L2hlYWQ+PGJvZHk+PG1haW4+PHAgY2xhc3M9ImJyYW5kIj5GNSDCtyBDdXN0b20gUmVzcG9uc2VzPC9wPjxoMT5SZXNvdXJjZSBub3QgZm91bmQ8L2gxPjxwPlRoZSByZXF1ZXN0ZWQgZGVtbyByZXNvdXJjZSBpcyBtaXNzaW5nLiBDaGVjayB0aGUgYWRkcmVzcyBhbmQgdHJ5IGFnYWluLjwvcD48YSBocmVmPSIvZGVtby9wYW5lbCI+RXhwbG9yZSByZXNwb25zZSBjb250cm9sczwvYT48L21haW4+PC9ib2R5PjwvaHRtbD4="
}
}
}
]
}
}

Decoded preview (escaped):

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Resource not found</title><style>body{margin:0;background:#071b33;color:#fff;font:18px system-ui}main{max-width:42rem;margin:12vh auto;padding:2rem}.brand{color:#ff5f64;font-weight:700}h1{font-size:clamp(2rem,6vw,3.5rem)}p{line-height:1.6}a{color:#9cddff}</style></head><body><main><p class="brand">F5 · Custom Responses</p><h1>Resource not found</h1><p>The requested demo resource is missing. Check the address and try again.</p><a href="/demo/panel">Explore response controls</a></main></body></html>

Verified live example: Open the missing-resource page.

Expected result: The selected path returns 404 and “Resource not found”.

Visitor message: Resource retired

This alternative selects exactly /demo/gone and sets 410. Use it when you can tell callers the removal is permanent.

{
"spec": {
"routes": [
{
"direct_response_route": {
"path": {
"path": "/demo/gone"
},
"http_method": "ANY",
"route_direct_response": {
"response_code": 410,
"response_body_encoded": "string:///PCFkb2N0eXBlIGh0bWw+PGh0bWwgbGFuZz0iZW4iPjxoZWFkPjxtZXRhIGNoYXJzZXQ9InV0Zi04Ij48bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoIj48dGl0bGU+UmVzb3VyY2UgcmV0aXJlZDwvdGl0bGU+PHN0eWxlPmJvZHl7bWFyZ2luOjA7YmFja2dyb3VuZDojMDcxYjMzO2NvbG9yOiNmZmY7Zm9udDoxOHB4IHN5c3RlbS11aX1tYWlue21heC13aWR0aDo0MnJlbTttYXJnaW46MTJ2aCBhdXRvO3BhZGRpbmc6MnJlbX0uYnJhbmR7Y29sb3I6I2ZmNWY2NDtmb250LXdlaWdodDo3MDB9aDF7Zm9udC1zaXplOmNsYW1wKDJyZW0sNnZ3LDMuNXJlbSl9cHtsaW5lLWhlaWdodDoxLjZ9YXtjb2xvcjojOWNkZGZmfTwvc3R5bGU+PC9oZWFkPjxib2R5PjxtYWluPjxwIGNsYXNzPSJicmFuZCI+RjUgwrcgQ3VzdG9tIFJlc3BvbnNlczwvcD48aDE+UmVzb3VyY2UgcmV0aXJlZDwvaDE+PHA+VGhpcyBkZW1vIHJlc291cmNlIGhhcyBiZWVuIHBlcm1hbmVudGx5IHJldGlyZWQuIENob29zZSBhIGN1cnJlbnQgcmVzb3VyY2UuPC9wPjxhIGhyZWY9Ii9kZW1vL3BhbmVsIj5FeHBsb3JlIHJlc3BvbnNlIGNvbnRyb2xzPC9hPjwvbWFpbj48L2JvZHk+PC9odG1sPg=="
}
}
}
]
}
}

Decoded preview (escaped):

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Resource retired</title><style>body{margin:0;background:#071b33;color:#fff;font:18px system-ui}main{max-width:42rem;margin:12vh auto;padding:2rem}.brand{color:#ff5f64;font-weight:700}h1{font-size:clamp(2rem,6vw,3.5rem)}p{line-height:1.6}a{color:#9cddff}</style></head><body><main><p class="brand">F5 · Custom Responses</p><h1>Resource retired</h1><p>This demo resource has been permanently retired. Choose a current resource.</p><a href="/demo/panel">Explore response controls</a></main></body></html>

Verified live example: Open the retired-resource page.

Expected result: The selected path returns 410 and “Resource retired”. An unrelated path still reaches the application.

On this shared load balancer, both direct error statuses need matching more_option.custom_errors bodies for their intended pages to appear. Add the relevant mapping to the same load balancer as its route. These mappings also apply to eligible edge-generated errors; they do not prove that origin-generated 404 or 410 bodies are replaced.

{
"spec": {
"more_option": {
"custom_errors": {
"404": "<ENCODED_RESPONSE_BODY>",
"410": "<ENCODED_RESPONSE_BODY>"
}
}
}
}

See Error responses for mapping eligibility and Maintenance for a temporary unavailable-service response.