How Custom Pages works
Follow how a custom page set replaces the error response of a Connector with your own page, and which status codes get Azion's default page.
When an origin cannot find a resource, or does not respond in time, the client receives an error response, such as 404 or 504. A custom page replaces that response with content you choose.
Custom Pages is a Platform Resource that replaces the error response returned by a Connector with a page of your own, one page per error status code. On API v4, Custom Pages takes the place of Error Responses, the error page settings of an Application on API v3. For an Application that still runs on API v3, refer to Error Responses.
This page covers the mechanisms rather than the fields: every field is on Custom page settings, and every bound is on Custom Pages limits. For the path of a request through Custom Pages, with a diagram, refer to Request path. The sections cover, in order, error responses, custom pages and custom page sets, page content from a Connector, the status codes a page can replace, Azion’s default error page, and the deployment.
Error responses
An error response carries a status code that says the request failed: a client error (4xx) or a server error (5xx). On Azion, the Application sends a request to the origin through a Connector, and the Connector answers with a status code. A custom page acts after the Application receives that response, and the status code decides whether a page applies.
Custom pages and custom page sets
A custom page replaces the error response for one status code, and a custom page set is the named list that groups those pages. When the Connector answers with a status code, Azion looks for a page with that code in the custom page set that the Workload’s deployment sets. Each page acts only on the status code it lists, such as "404", so a set holds one page for each code it replaces.
When a page matches, the client receives the page’s content in place of the response. The response carries no redirect and no Location header, so the browser stays on the URL it requested. A set holds at least one page, as Custom Pages limits states.
Page content from a Connector
A page of the page_connector type sets a Connector and the path of the page’s content on that Connector. Azion fetches the content from the page’s Connector at the page’s uri. The page’s ttl sets the cache time of that content. A page can also set custom_status_code, the status code the client receives instead of the original one.
For example, your origin answers a deleted product page with 404. A page for the code 404 then serves the document at its uri, such as /myerrors/404.html, still with status 404, and the browser shows your page.
For the type and the default of each field, refer to Page fields.
Status codes a page can replace
A page can replace only a status code from a fixed list of 22 codes: 16 client errors (4xx) and six server errors (5xx). For each code in the list and what it means when the Connector returns it, refer to Status codes.
Azion’s default error page
When the custom page set has no page for a status code, the client receives the Connector’s response unchanged. Eight codes are the exception: 400, 401, 403, 406, 500, 502, 503, and 504 receive Azion’s default error page instead. A page for one of those eight codes replaces Azion’s default error page with yours.
For example, a set that holds only a 404 page answers a 502 from the Connector with Azion’s default error page, not with the origin’s response. A Workload whose deployment sets no custom page set passes every response unchanged.
The deployment
A Workload uses a custom page set only once that Workload’s deployment sets that custom page set. A Workload holds at most one deployment, so one custom page set covers every hostname of the Workload. For the deployment fields, refer to Workload settings.
Assigning a set is a change to the Workload’s deployment, and that change propagates. It spreads across Azion’s distributed infrastructure, data center by data center, over several minutes. Meanwhile, requests can receive the previous or the updated configuration, depending on the data center that answers. For that reason, Azion does not guarantee when an assigned set starts to serve, as Propagation explains.
To set the custom page set in the deployment, refer to Customize an error page.