Caddy isn’t a DNS server, so there’s nothing on your system to tell your browser that you want wsl.files.local to map to 127.0.0.1, i.e. same as localhost.
You should read this article:
This assumes you want to make your server publicly accessible though.
Ultimately, Caddy is not the problem here, you just need to go out and learn how DNS works. The internet has lots of resources on the topic, just go look for them