Find out how to configure your Azion application to show custom error pages for your user based on HTTP error statuses. For this guide you must already have an Application, a Connector and a Workload already setup.
There are separate instructions for API v3 using legacy Error Responses settings and API v4 using the new Custom Pages product.
To create a Custom Page, follow the steps:
- Access Azion Console > Custom Pages.
- Click on the + Custom Page button.
- To customize specific error codes, click on the + Custom Page Code button.
- Select the Page Code. This represents the code recieved from the Connector when fetching your content.
- Select the Connector.
- In the Page Path field, you can add a path to an error page created in your origin.
- Change the cache TTL in the Response TTL field.
- In the Response Custom Status Code field, you can customize the HTTP status that will be received by the user.
- Click the Save button.
Now to bind your Error Pages to your Workload, follow the steps:
- Access Azion Console > Workloads.
- In the Deployment Settings section, select the Custom Page you created.
- Click the Save button.
Done. Your application will now display an error page with the new configuration.
To customize an error response page, follow the steps:
- Access Azion Console > Applications.
- Select the application linked to the domain that needs the new error page.
- Select the Error Responses tab.
- The first Status Code field is disabled, but in Default Response TTL you can set the cache time-to-live (TTL), in seconds, of all error pages.
- This first status code serves as a placeholder to cache the page in case an unexpected status is received.
- To customize specific error codes, click the + Add Error Response button.
- In the new Status Code field, select the status code you want to customize.
- Change the cache TTL in the Custom Response TTL field.
- You can keep the same cache TTL set in the previous field or add a different TTL.
- In the Page Path field, you can add a path to an error page created in the source.
- In the Response Status Code field, you can customize the HTTP status that will be received by the user.
- In the Set Origin section, you can define the origin of error page URIs.
- You can configure their origins in the application’s Origins tab.
- Click the Save button.
Done. Your application will now display an error page with the new configuration.