diff --git a/caddy/error.html b/caddy/error.html new file mode 100644 index 0000000..68bff2c --- /dev/null +++ b/caddy/error.html @@ -0,0 +1,91 @@ + + + + + + Caddy Error + + + + +
+
{{ph "http.error.status_code"}}
+

{{ph "http.error.text"}}

+ Go Home +
+ + diff --git a/caddy/readme.md b/caddy/readme.md index bf4ac7c..5614851 100644 --- a/caddy/readme.md +++ b/caddy/readme.md @@ -52,3 +52,10 @@ Place all other config files inside `/etc/caddy/conf.d/` directory and import Ca ```Caddyfile import conf.d/*.Caddyfile ``` + +## Handling errors + +We can setup seperate error pages for different kind of error. But I'll be using single `error.html` page which is a [caddy template](https://caddyserver.com/docs/caddyfile/directives/templates) page and I can fill in error msg and error code using [placeholders](https://caddyserver.com/docs/modules/http.handlers.templates#placeholder). +For reference look at [error.html](./error.html) file. + +To learn more about it check the Caddy docs **RTFM** about [handling errors](https://caddyserver.com/docs/caddyfile/directives/handle_errors).