How to block access deny folder or file with dot in first name

hi . i want to same config like ngnix in caddy

bellow code dot allow open file with dot like .env

   location ~ /\.(?!well-known).* {
        deny all;
    }

Use path_regexp

thanks please show sample

The page itself has an example.