I have a doubt on the use of ‘handle’.
Are the following two blocks of code equivalent? [As in, will they produce the same effect?]
handle /api/* {
reverse_proxy 127.0.0.1:9720}
handle /api/blah/* {
reverse_proxy 127.0.0.1:9730}
handle /api/blah/* {
reverse_proxy 127.0.0.1:9730}
handle /api/* {
reverse_proxy 127.0.0.1:9720}
or is the second handle in the first example (api/blah) redundant, as Caddy will evaluate the handle blocks in the order in which it finds them, instead of going to the most specific (longest) matcher first?
If, on the other hand, it does reorder them (and execute the handle with the most specific/longest matcher first), perhaps we should mention it in this article – Composing in the Caddyfile
The sense I got from the article otherwise is that it won’t reorder the handles on the basis of specificity and will execute them as it finds them, and in that way, handle is different from most other directives such as reverse proxy and header. Is that the correct understanding?