From 570488d7f666ab1582a33fe444f3ea1f6a776b9d Mon Sep 17 00:00:00 2001 From: Andy Pilate Date: Mon, 23 Nov 2020 19:22:19 +0100 Subject: [PATCH] docs: Replaced http.cat example with single line respond (#106) * Fix http.cat example with Host * Add simpler example using respond --- .../markdown/caddyfile/directives/handle_errors.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/docs/markdown/caddyfile/directives/handle_errors.md b/src/docs/markdown/caddyfile/directives/handle_errors.md index ba275ed..137f8e6 100644 --- a/src/docs/markdown/caddyfile/directives/handle_errors.md +++ b/src/docs/markdown/caddyfile/directives/handle_errors.md @@ -48,6 +48,16 @@ Reverse proxy to a professional server that is highly qualified for handling HTT ```caddy handle_errors { rewrite * /{http.error.status_code} - reverse_proxy https://http.cat + reverse_proxy https://http.cat { + header_up Host http.cat + } +} +``` + +Simply use [`respond`](/docs/caddyfile/directives/respond) to return the error code and name + +```caddy +handle_errors { + respond "{http.error.status_code} {http.error.status_text}" } ```