-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpcaddyfile: Add error
directive for the existing handler
#4034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! I do have a question regarding the directive order but no answer or preference as to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
error
handler that already exists: https://caddyserver.com/docs/json/apps/http/servers/routes/handle/error/Syntax: