handling errors

This commit is contained in:
Kulvir Singh
2025-10-15 02:35:39 +05:30
parent 6e877b5e85
commit 9d3b3b7940
2 changed files with 98 additions and 0 deletions

View File

@@ -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).