You may supply any HTML content to display to clients in case of errors, these error pages will override the default X4B Pages. These error pages will not however override any error pages served from your web server which will not be touched by our services

Error Page defaults

All error codes (and mitigation pages) available for user override have default error pages provided by us. These error pages provided by us are available in multiple languages. Language contributions are largely provided by customers, if you wish to contribute a translation please contact us.

Default Error Pages (served by us) can be identified by a comment of <!-- X4B --> before the final HTML tag. Unless the error page relates to a billing matter (such as non-payment) we do not include visible branding in these pages. You can view HTML comments from the "View Source" page of your web browser or with software that displays HTML as text output (such as curl).

Error Page override

All HTTP Error Pages can be overridden by customers at the (virtual) port level.

The available error pages include:

  • HTTP 403: Forbidden due to ACL
  • HTTP 408: Client Timeout
  • HTTP 481: Insecure Request
  • HTTP 497: A HTTP request sent to a HTTPS port
  • HTTP 500: Internal Service Error
  • HTTP 502: Bad Backend
  • HTTP 503: Service Unavailable
  • HTTP 504: Backend Timeout
  • HTTP 521: Too Many Connections (HTTP 503)
  • HTTP 522: Request Limited (HTTP 503)

Redirection URL

Optionally a redirection URL may also be supplied. Redirection URLs may also include the following variables:

  • $scheme - Either http or https depending on the clients connection
  • $host - The connecting hostname
  • $uri - The request path component including the starting "/"
  • $request_uri - The request path component including the starting "/"

    Redirection URLs allow for redirection on error. Redirects may be either Temporary or Permanent and may optionally also forward POST data.

    On Error code "481: Insecure Request" this may be used to redirect HTTP (insecure) traffic received on a HTTPS port which can be useful for certain applications.

Maintenance

You may supply any HTML content to display to clients in case of maintenance. This page will be shown when the maintenance flag is set below. A redirection URL may also be provided.

If you wish you can exclude certain IPs from seeing the Maintenance mode. These clients will be able to access the backend during maintenance. By default the Maintenance page is shown to all clients when enabled. These addresses can be specified using the same format as used for ACLs

UUIDs

Default X4B error pages include a request UUID in the footer of each generated error messages (not compatible with Safari, including iOS). This UUID can be used to identify a specific request in the error log in your dashboard. This UUID is also sent to the backend server in a header defined by you if enabled (off by default), for more information see the HTTP Options documentation.

If you would like to include the request UUID in your custom error pages you may do so by including a version of the following HTML snippet in your error page:

const observer = new PerformanceObserver((list) => {
  list.getEntries().forEach((entry) => {
    entry.serverTiming.forEach((serverEntry) => {
        if(serverEntry.name == "x4b" && document.getElementById("uid").innerText.length == 0) document.getElementById("uid").innerText=serverEntry.description
    });
  });
});

["navigation", "resource"].forEach((type) =>
  observer.observe({ type, buffered: true }),
);

This will store the UUID in the element with the ID of "uid" which you can then display in your error page. You may modify this snippet to meet your needs. However note only the first observed uuid should be displayed (the failed request).