My problem is that the reverse_proxy that matches everything takes precedence on the more specific one, regardless of the order in which the two directives appear in Caddyfile.
I don’t want to use route or handle because I would like to import the configuration of the two independently.
So my current solution is to use:
@not_abc {
not path /abc*
}
reverse_proxy @not_abc https://everything
This works but it is again coupling the two.
Why reverse_proxy are not sorted from the more specific to the less specific? Is there a why to do that?
OK, I’ve figured it out: reverse_proxy https://everything was actually inside a route, so it was taking precedence on the other one even if less specific.
The proper solution is to put also the other one inside a more specific route, something like:
The route is likely not necessary there, but it depends on what the rest of your Caddyfile is doing. Next time, please post your whole Caddyfile, because it’s impossible to accurately help without seeing the whole thing.