From f1dba7be0670781e3ce1ae10490cb51e27a63a9e Mon Sep 17 00:00:00 2001 From: Mateo Date: Tue, 23 Jul 2024 14:18:32 +0200 Subject: [PATCH] Simple error handling with caddy --- templates/Caddyfile.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/Caddyfile.j2 b/templates/Caddyfile.j2 index 90e31ea..fd05842 100644 --- a/templates/Caddyfile.j2 +++ b/templates/Caddyfile.j2 @@ -18,6 +18,14 @@ poc.athelas.fr { ca https://acme-staging-v02.api.letsencrypt.org/directory } + handle_errors { + rewrite * /{err.status_code} + reverse_proxy https://http.cat { + header_up Host {upstream_hostport} + replace_status {err.status_code} + } + } + } # Refer to the Caddy docs for more information: