Use Caddy for listen to all domains

That looks like a Caddyfile for Caddy v1.

For reference, you do not need this block:

     {
         ext .php
         split .php
         index index.php
     }

The php preset does all of this for you, so that fastcgi configuration can just be one line.

As for the tlsv1 alert, that’s most likely happening when Caddy doesn’t have a certificate for the site you tried to access.

Since you haven’t told Caddy which domains you’re serving, it can’t get certificates in advance. Since it has no certificate, it sends none, aborting the connection.

You can configure Caddy to fetch brand new certs mid-request. This is called On-Demand TLS and is documented for v1 here: https://caddyserver.com/v1/docs/automatic-https#on-demand