Extract for the Caddy V2 documentation…
This suggests that the download root is
https://github.com/caddyserver/caddy/releases/latest/download with the ASSET choices listed under https://github.com/caddyserver/caddy/releases. For example, the FreeBSD (x64) version of the static binary is named
The naming convention used for the asset doesn’t lend itself to scripting the download of the latest version because the version number is included in the asset name. When, say, 2.2.0 of a static binary is released, the script would have to be modified to point to the new asset. From a scripting perspective, it would be helpful if the asset name for the latest version were independent of the version number e.g.
caddy_freebsd_amd64.tar.gz. When the script is run, it would acquire the latest version whatever that might be at the time.