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: SCALINGO_STOPPED_PAGE_URL=

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

The SCALINGO_NO_FRONT_ERROR_URL environment can be used to display a specific page when an application is in maintenance. Here are the steps:

  1. Set the SCALINGO_NO_FRONT_ERROR_URL environment variable to point to a valid URL containing the maintenance page.
  2. Scale down the web containers to 0.
  3. 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.
  4. Scale back up the web containers to the original value.

Suggest edits

Custom Error and Maintenance Pages

©2024 Scalingo