Simple but pretty unicorn rainbow error pages for webserver 40x/50x HTTP errors
Go to file
2021-11-28 10:19:48 -05:00
.github initial commit 2021-08-02 17:05:36 -04:00
configuration updated more deps, major versions 2021-11-25 14:30:01 -05:00
dist update deps, fix bg-cover issue, increment version 2021-11-28 10:19:48 -05:00
src update deps, fix bg-cover issue, increment version 2021-11-28 10:19:48 -05:00
.babelrc initial commit 2021-08-02 17:05:36 -04:00
.eslintrc initial commit 2021-08-02 17:05:36 -04:00
.gitignore initial commit 2021-08-02 17:05:36 -04:00
.prettierrc initial commit 2021-08-02 17:05:36 -04:00
.sasslintrc initial commit 2021-08-02 17:05:36 -04:00
.travis.yml initial commit 2021-08-02 17:05:36 -04:00
CHANGELOG.md initial commit 2021-08-02 17:05:36 -04:00
LICENSE initial commit 2021-08-02 17:05:36 -04:00
package-lock.json update deps, fix bg-cover issue, increment version 2021-11-28 10:19:48 -05:00
package.json update deps, fix bg-cover issue, increment version 2021-11-28 10:19:48 -05:00
postcss.config.js initial commit 2021-08-02 17:05:36 -04:00
README.md finished README update with caddy config 2021-11-25 15:04:11 -05:00
SECURITY.md initial commit 2021-08-02 17:05:36 -04:00
svgo.config.js initial commit 2021-08-02 17:05:36 -04:00
tailwind.config.js initial commit 2021-08-02 17:05:36 -04:00
webpack.config.js updated to support caddy custom error pages 2021-11-25 15:02:50 -05:00

73k.us custom rainbow error pages (40x/50x)

Based off frontend-webpack-boilerplate with TailwindCSS added.

Builds html & css that can be used as custom error page templates with caddy.

NOTE

After production build, optionally remove the empty, 0-byte app.js script tags from the built files, just to optimize things further.

caddy example

With this snippet in the Caddyfile, for a site one can import err to handle errors for that site.

(err) {
	root /err_css/* /www/err
	root /err_images/* /www/err
	respond /unknown_error_not_4xx_not_5xx "{http.error.status_code} {http.error.status_text}"

	handle_errors {
		@4xx expression `{http.error.status_code} >= 400 && {http.error.status_code} < 500`
		@5xx expression `{http.error.status_code} >= 500 && {http.error.status_code} < 600`

		root * /www/err
		encode zstd gzip
		file_server

		rewrite @4xx /4xx.html
		rewrite @5xx /5xx.html
		rewrite * /unknown_error_not_4xx_not_5xx
		templates
	}
}