Automatic error page generator for monthaselino
Go to file
Sven Vogel 9733bd2f07 bind address can be configured by environment variables 2023-11-24 23:42:32 +01:00
web completed go rewrite 2023-11-24 23:22:19 +01:00
.gitignore added devbox for go rewrite 2023-11-24 18:55:12 +01:00
Dockerfile added dockerfile 2023-11-24 23:42:05 +01:00
LICENSE Initial commit 2023-10-16 12:25:36 +00:00
Makefile added Makefile 2023-11-24 23:42:14 +01:00
README.md release version 1.0.1 2023-10-16 14:53:24 +02:00
devbox.json completed go rewrite 2023-11-24 23:22:19 +01:00
go.mod initialized go project 2023-11-24 20:00:35 +01:00
index-inlined-minified.html completed go rewrite 2023-11-24 23:22:19 +01:00
main.go bind address can be configured by environment variables 2023-11-24 23:42:32 +01: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
    }
}