-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
handle inside handle_errors does not work if handle_errors <status code> is used #6957
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
Comments
If you adapt to JSON with |
If I use adapt to create the JSON the problem is obvious. You can see that the matcher of the inner handle is ignored an it is always the 404 matcher. Caddyfile:
caddy adapt --config Caddyfile --pretty
|
Huh, yeah that shouldn't happen. It should make sure that all routes are within a subroute, so that they run at the correct layer. PRs welcome if you want to take a shot (I'm a bit busy right now) |
I tried to create language dependent custom 404 error pages with the following configuration:
But this does not work. It will always evaluate the directives in the first
handle
block. I also tried named matchers with different matchers (path, path_regexp, file) it always runs the firsthandle
block.I solved my problem by using the following slightly more complex version which works as excpected:
The problem was consistent reporducable on
OS: Debian Buster
Caddy version: v2.9.0 h1:rteY8N18LsQn+2KVk6R10Vg/AlNsID1N/Ek9JLjm2yE=
and
OS: Ubuntu 24.04 (WSL)
Caddy version: v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
The text was updated successfully, but these errors were encountered: