Custom Error and Maintenance Pages
Custom Error Pages
Our routers may return an error page when an application is unreachable. By default, the error page looks like the following:
You can customize these pages by providing Scalingo with a custom error page URL. Four different error pages can be customized. You need to set one of these environment variables depending on which error page you want to customize:
SCALINGO_NO_FRONT_ERROR_URL: if the application has no web container running but other types of containers are.
SCALINGO_STOPPED_PAGE_URL: if the application has no running container.
SCALINGO_APP_ERROR_URL: if the application returns a 502 HTTP response, crashed or cut the connection unexpectedly.
SCALINGO_TIMEOUT_ERROR_URL: if the application returns a 504 HTTP response or timed out.
The usage is the following:
In order to prevent the page to be fetched at each request, the content is cached in the router’s memory. Hence we limit the size of this page to 10MB.
It is mandatory to restart the application for the configuration of these pages to be taken into account.
Custom Maintenance Page
SCALINGO_NO_FRONT_ERROR_URL environment can be used to display a specific
page when an application is in maintenance. Here are the steps:
- Set the
SCALINGO_NO_FRONT_ERROR_URLenvironment variable to point to a valid URL containing the maintenance page.
- Scale down the
webcontainers to 0.
- Execute all the operations needed for as long as you need. During this step, the maintenance page will be displayed for any request to the application.
- Scale back up the
webcontainers to the original value.