Automatic error page generator for monthaselino
Go to file
Sven Vogel fd47eb1216 added devbox for go rewrite 2023-11-24 18:55:12 +01:00
php added custom nginx config for setting custom response code 2023-10-16 19:11:55 +02:00
.gitignore added devbox for go rewrite 2023-11-24 18:55:12 +01:00
Dockerfile added custom nginx config for setting custom response code 2023-10-16 19:11:55 +02:00
LICENSE Initial commit 2023-10-16 12:25:36 +00:00
README.md release version 1.0.1 2023-10-16 14:53:24 +02:00
devbox.json added devbox for go rewrite 2023-11-24 18:55:12 +01:00
nginx.conf added custom nginx config for setting custom response code 2023-10-16 19:11:55 +02:00

README.md

error-pages

Error pages for montehaselino.de. The service is to used as a quick error response service. It delivers a single html file as response with every resource inlined and encoded into it.

Make sure to compile every resource into the main.php file. This is due to the fact, that the error response is not a redirect to a public web server but rather an response for by the reverse proxy from an restricted backend. Make sure to inline resources:

npm install inliner
npx inliner index.php > index-inlined-minified.php

Example configuration for caddy:

reverse_proxy https://service {
    @custom_error status 4xx 5xx
    handle_response @custom_error {
        # rewrite uri to be the status code
        rewrite * /{rp.status_code}
        # send automatically generated response page
        # the answer must be a single html file without resource from the same origin
        reverse_proxy http://error-response:8080
    }
}