Custom Pages

Custom Pages is an Azion feature that allows you to customize error pages for users based on the status code received from an Edge Connector.

When a user requests content from an edge application, Azion sends the request to the origin servers using Edge Connector. As a response, the Edge Connector sends back an HTTP status code, which indicates whether or not the request has been completed.

With Custom Pages, you can customize how your application will handle Client (4xx) and Server (5xx) error types. This way, when a request is made to a URL that can’t be found at the origin or when the server is unable to respond, the user will be redirected to a custom error page, whose contents can be cached.

Implementation

ScopeResource
Edge Application first stepsFirst steps
Customizing error pageHow to customize an error response page
Edge ConnectorEdge Connector reference
WorkloadsWorkloads reference
Custom Pages APIAPI reference

Page Codes

The code Azion receives from the Edge Connector when connecting to the origin.

These are the available status codes:

Status CodeDescription
400: Bad RequestRequest error caused by invalid parameters, missing required parameters, or others.
401: UnauthorizedError resulting from a lack of the Authentication HTTP header.
403: ForbiddenLack of user permissions to execute the operation.
404: Not FoundThe resource requested doesn’t exist.
405: Method Not AllowedThe requested method can’t be applied to the URL.
406: Not AcceptableAccept header wasn’t found in the HTTP request or header contains content whose formatting or version isn’t supported by the API.
408: Request TimeoutThe server informs that the request is coming in slower than the server is prepared to wait. This means the server would like to terminate the connection.

This response is often used since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection to speed up navigation. Also, some servers take down the connection without sending this message.
409: ConflictConflict in the execution of the request, such as creating an existing registry.
410: GoneThis response is sent when the requested content was permanently deleted from the server, without a preset redirect address. If this error happens, any caches or links to this resource should be removed.

The HTTP specification describes that this code should be used for “limited promotional services”. APIs shouldn’t be made to indicate which resources were removed with this status code.
411: Length RequiredThe server has rejected the request because the header Content-Length is undefined but required by the server.
414: URI Too LongThe requested URI is larger than the server’s limits.
415: Unsupported Media TypeThe media format of the requested data is unsupported by the server, so the server rejects it.
416: Request Range Not SatisfiableThe value specified by the Range header couldn’t be filled; it’s likely that it’s out of range of the target URI data.
426: Upgrade RequiredThe server refuses to execute the requisition using the current protocol, but it’ll be ready to do so after the client updates to a different protocol. The server sends an Upgrade header response to indicate the required protocols.
429: Too Many RequestsThe request was temporarily rejected for exceeding operation limits. The client must wait until the moment defined in the X-Ratelimit-Reset and try again.
431: Request Header Fields Too LargeThe request’s headers are too long or too many cookies were sent in the request.
500: Internal Server ErrorUnintentional error, fault unidentified in the processing of the request.
501: Not ImplementedThe request method is unsupported by the server and can’t be modified. The only methods required for servers to support (and thus shouldn’t return this code) are GET and HEAD.
502: Bad GatewayThis error response means that the server, working as a gateway in order to obtain a necessary response to manipulate the request, obtained an invalid response.
503: Service UnavailableThe server isn’t ready to handle the request. Common causes are an overloaded server or a server under maintenance. Next to this response, a friendly page explaining the problem should be sent.

These responses should be used for temporary conditions and the Retry-After header should contain the estimated time to recover the service. The webmaster should also be careful with the caching related headers that are sent with this response, since these temporary condition responses shouldn’t normally be cached.
504: Gateway TimeoutThis error response is sent when the server is acting as a gateway and doesn’t obtain a response in time.
505: HTTP Version Not SupportedThe HTTP version used in the request isn’t supported by the server.

Response TTL

Defines the time in seconds that the error page will remain in cache before it’s refreshed.

Learn more about cache expiration settings

Page Path (URI)

This path specifies the internal URL from which your Edge Connector delivers the payload. For example, if you set the path to /myerrors/505.html and your Edge Connector address is myconnector.azion.com, the content will be fetched and delivered from myconnector.azion.com/myerrors/505.html.


Response Custom Status Code

Status code that will be delivered to the user instead of the original one. For example, you can configure the application to return a 404 response code when a 403 error occurs.