httpcaddyfile: Add error directive for the existing handler#4034
httpcaddyfile: Add error directive for the existing handler#4034mholt merged 2 commits intocaddyserver:masterfrom
error directive for the existing handler#4034Conversation
mholt
left a comment
There was a problem hiding this comment.
Thanks, LGTM! I do have a question regarding the directive order but no answer or preference as to that.
mholt
left a comment
There was a problem hiding this comment.
Alright, cool, let's give this a try and see if it's useful!
|
This was one of the things keeping me on an older version of Caddy, so thank you for this. |
|
@habibalamin which version? This isn't something that existed in a previous version. |
|
Sorry, I was a bit unclear. There was a “rewrite hack” for the exact use case in the linked issue that you could do in v1 but not v2, and adding this directive gets me one step closer to letting me migrate to v2, i.e. this isn't something that existed in an older version, but it was something you could mimic with a workaround that's no longer allowed in v2 (which cleaned things up). |
Docs for the new directive in caddyserver/caddy#4034. Also adding a bit in `handle_errors` mentioning that `reverse_proxy` doesn't trigger errors when a response has an "error" HTTP status; not sure how to word this clearly, cause `reverse_proxy` still can trigger errors if there's no upstream or whatever. We should probably add examples for that later, and augment this paragraph to mention `handle_response` once that's merged (caddyserver/caddy#4021)
Closes #3782
Just adds Caddyfile support for the static
errorhandler that already exists: https://caddyserver.com/docs/json/apps/http/servers/routes/handle/error/Syntax: