A lightweight Express-based custom HTTP error page service designed to be used as a standalone container or behind a reverse proxy (e.g., Nginx, Traefik). It serves clean, user-friendly error pages for standard HTTP error codes (403, 404, 500, 502, 503, 504) β with full support for custom HTML templates.
5xx.html or a generic EJS template if a file doesnβt existImage Name:
avisenaalwi/custom-http-error-page
You can pull it directly from Docker Hub:
docker pull avisenaalwi/custom-http-error-page:latest
Run the container on port 8080 (or any port you like):
docker run -d \
-p 8080:80 \
--name custom-http-error-page \
avisenaalwi/custom-http-error-page
Now open your browser and visit:
http://localhost:8080/404
or
http://localhost:8080/500
The container looks for HTML files in /app/templates. You can override or add your own template by mounting a volume. Example:
docker run -d \
-p 8080:80 \
-v $(pwd)/templates:/app/templates \
--name custom-http-error-page \
avisenaalwi/custom-http-error-page
In your local folder ./templates, place any of these files:
File Name Purpose
π‘ If the requested file (e.g., 404.html) is missing, the app will automatically fall back to 5xx.html, or render a default EJS-based template.
If you want to modify or extend the app locally:
git clone https://github.com/avisenaalwi/custom-http-error-page.git
cd custom-http-error-page
npm install
npm run start
http://localhost:8080/404
Example docker-compose.yml:
version: '3.8'
services:
custom-http-error-page:
image: avisenaalwi/custom-http-error-page:latest
container_name: custom-http-error-page
ports:
- "8080:80"
volumes:
- ./templates:/app/templates
environment:
- NODE_ENV=production
Then run:
docker compose up -d
Variable Default Description PORT 8080 Port used by Express inside the container NODE_ENV production Node environment mode
Route Example Description
Each HTML file can be fully customized with your own design and assets. For best UX, include the following meta tags for responsiveness and dark-mode support:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark">
π§° License
Licensed under the Apache 2.0 License. Β© 2025 Avisena Alwi
β€οΈ Example Screenshot (optional)
You can include screenshots here showing 404/500 pages once ready.
π Future Plans
π Built-in theme switcher (light/dark)
π Multi-language template support
π§ Dynamic error customization via environment variables
Made with β€οΈ by Avisena Alwi
Content type
Image
Digest
sha256:7dd17ad82β¦
Size
59.1 MB
Last updated
12 months ago
docker pull avisenaalwi/custom-http-error-page