Instead of using handle_path, I need to use header as defined in Caddy's documentation here https://caddyserver.com/docs/caddyfile/directives/header
Here's the corrected version of my Caddyfile
<my domain> {
root * /home/<my username>/caddy
header /Build/Build.data.gz {
Content-Encoding gzip
Content-Type application/gzip
}
header /Build/Build.framework.js.gz {
Content-Encoding gzip
Content-Type application/javascript
}
header /Build/Build.wasm.gz {
Content-Encoding gzip
Content-Type application/wasm
}
header /Build/Build.loader.js {
Content-Type text/javascript
}
# Default handling for other files, e.g., frontend routes
try_files {path} /index.html
file_server
}