Caddy v2 configuration: Nextcloud Docker PHP-FPM with rules from .htaccess

@francislavoie suggested in another thread this, which looks quite close:

@davclnt header_regexp User-Agent (?i)^DavClnt
redir @devclnt /remote.php/webdav{uri} 302

About the rewrites/ redirects thing, I am also using redirects for a long time now and didn’t get any errors, so it doesn’t seem to make much of a difference/ is both supported by the clients.
Still, you have a point that it would be closer to the original Apache config.