Lightweight tool to create static custom HTTP Error Pages in minimalistic adaptive and accessible design with customization and localization support.
- Static pages with simple and responsive design
- Lightweight and fast running
- Extensibility
- Customization
- Localization (i18n)
- Accessibility (a11y)
- Built-in web server config generator (Nginx)
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 410 Gone
- 500 Internal Server Error
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
If you want to get already precompiled packages, please download latest version from official website.
Requirements: installed Node.js 11+
- Checkout this repository to your local machine
- Run
npm install --production
command to install dependencies - Run
npm run build
command to compile error pages and web server configs - Copy static html files from
dist
directory to your server - Copy and apply config snippet from
dist
to your web server configuration (see details below).
Nginx
Nginx config located in /dist/<locale>/nginx-error-pages.conf
file and can be copied to /etc/nginx/snippets/
directory. According to this config file, all html pages and their assets must be placed in the /usr/share/nginx/html/error-pages
directory. After copying all files you have to update your server configuration with include /etc/nginx/snippets/nginx-error-pages.conf;
line.
- Extensibility New pages can be added by adding new json files in
scr/<locale>
directory. The page name must follow to format<HTTP code>.json
(<HTTP code>
is Number, related to specific HTTP status code). You can put any additional data to json files that you want to display on a page. In case of common variables, you can use thecommon.json
file to define them. - Customization By editing the default theme you can add anything you want. In case if you want to have your own page design, you can create a new theme and apply it by editing
config.json
file. All assets (images, fonts, etc) must be placed in the@assets
directory (note: the@assets
name is used to avoid a naming collision with default assets directory name in common cases). By default the mustache.js is used as a template engine and Tailwind as a CSS framework. Entry point of Tailwind styles must be located inthemes/<name>/@assets/css/main.twnd.css
file. Custom Tailwind theme settings can be added to thetheme.tailwind.config.js
file located in the root of the theme directory. If you don't want to use Tailwind builder, then it can be disabled by editing thetailwind
option inconfig.js
. - Localization If you need to change default text messages, then you can simply edit existing files in
src/<locale>
directory according to your needs. If you want to create your own localization, just simply add a new locale directory and create a set of source files. After new locale adding, changelocale
property inconfig.json
file, located in a root.
You are very welcome to contribute to this project with improvements, localizations, bug fixes and so on.