A lightweight Python tool to generate humorous and movie-themed HTTP error pages for reverse proxies (and similar use cases). Customize the generated pages by editing a YAML configuration file to suit your needs.
This project uses a combination of Jinja2 and PyYAML to render HTML error pages based on customizable settings. The provided template is designed with Tailwind CSS, making it visually appealing and easily adaptable for movie-related or other themed error messages.
- Customizable Errors: Define multiple error pages (e.g., 404, 500) with unique titles, quotes, descriptions, and images.
- Movie-Themed Customization: Out-of-the-box settings focus on movie-related content, but the setup is flexible enough to cater to any theme.
- Simple Configuration: Use the
settings.ymlfile to configure error details, such as background images, logos, and more. - Easy Integration: Generate standalone HTML files that can be used with reverse proxies or integrated into your web server setup.
-
Clone the Repository:
git clone https://your-repository-url.git cd your-repository-directory -
Create a Virtual Environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Your Error Settings:
Edit the
settings.ymlfile to customize error messages. For example, you can update the title, quote, description, images, and movie title. An example configuration:logo: https://example.com/logo.svg back_button_text: Back errors: 404: - title: Erreur 404 Not Found quote: a funy quote description: a funny description background_image: https://example.com/errors/404/background.jpg image: https://example.com/errors/404/image.jpg image_alt: If image is unloadable or for audio description movie_title: Obviously the movie title
-
Run the Generator Script:
By default, the script reads from
settings.ymland uses thebase.htmltemplate to generate error pages:python generate.py
Generated HTML files will be placed in the
error_pagesdirectory. You can also specify a different settings file or specific error codes as command-line arguments:python generate.py custom_settings.yml 404 500
-
Deploy the Generated Pages:
Use the generated HTML files as custom error pages on your web server or reverse proxy configuration.
-
Template Customization:
Modifybase.htmlto change the layout or add new elements. The file uses Jinja2 templating, so you can insert or update placeholders as needed. -
Error Settings:
Update thesettings.ymlfile to change error codes, add multiple variations per error code, or adjust visual elements like logos and backgrounds. -
Styling:
The project includes Tailwind CSS via CDN in the template. You can modify the inline styles or replace Tailwind with your preferred CSS framework.
Feel free to fork the repository and submit pull requests for new features, bug fixes, or improvements. All contributions are welcome!
This project is open source and available under the MIT License.
For any questions or suggestions, please open an issue on the GitHub repository.
Enjoy creating your own funny and engaging error pages!




