Wordpress with Caddy V2

1. Caddy version (caddy version):

V2.2.1

2. How I run Caddy:

a. System environment:

Debian 10 normal install via apt install caddy

b. Command:

systemctl start caddy.service

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:

myblog.mydomain.com {

        root * /var/www/html/blog.com

        file_server

        encode gzip
        php_fastcgi unix//run/php/php7.3-fpm.sock

log     {
        output file /var/log/caddy/stephaniebreton.com.log
        format console
        }
}

3. The problem I’m having:

I can access myblog.mydomain.com but then permalinks are not working and access to wp-admin is not working. I tried to add in the Caddyfile: try_files {path} /index.php?{query}&p={path} but it also does not work. Basically whenever there is myblog.mydomain.com/[path] it does not work as it does not add the “index.php” in the uri, finally anything like myblog.mydomain.com/wp-admin/anyfile.php will not work such as myblog.mydomain.com/wp-admin/update-core.php

4. Error messages and/or full log output:

5. What I already tried:

I tried try_files {path} /index.php?{query}&p={path} but when i query a page it shows 404 error and sometimes after refreshing it works sometimes not.
I have searched for the past two days but all the config i see for wordpress are minimal and does not work for me

6. Links to relevant resources:

Thanks for your help as i am currently with Nginx but would like to use Caddy if i can get this wordpress to work.

You say “does not work”, but what isn’t working exactly? What’s the actual problem? What are in your logs? What do you see in your browser? What if you try with curl -v, what happens?