No worries - Caddy thinks the format of your Caddyfile is for a single-vhost setup. If you have multiple virtual hosts, each host’s directives must be enclosed in a curly brace block. Like so:
I think rewrite has this behaviour, if you’re looking to do this for a single resource. It’s got some quirks, though, be sure to check the docs: https://caddyserver.com/docs/rewrite
If you’re looking to do this site-wide, you’re almost certainly better off writing your website or web app to do this. Most web apps that achieve that kind of effect do it by only actually having one page, and streaming in resources.