I don’t understand where logs are being recorded. I think I have logs set up with the log directive to go to a file for each of my domains. With Caddy v1 access logs were written to the file. I’m not seeing logs recorded to these files with Caddy v2.
I don’t think the caddy user has permission to write to that location. I think if you specify the log file path as /var/log/caddy/plantsdb.log, it might work.
FYI, I don’t think this will do what you want. This will check if there’s a file on disk (relative to the directory in which Caddy is running) named .html (there won’t be), otherwise it will check for a file / on disk (there will pass, because the current directory exists).
try_files isn’t very useful along with reverse_proxy because Caddy doesn’t know what files the proxy is serving.
I think you’re probably looking for something closer to this, but I’m just hazarding a guess:
@notHtml {
not path *.html
}
rewrite @notHtml {path}.html
When installing with the apt repo, currently it’s only directories where the caddy user has permissions. I think by default it’s only /var/lib/caddy and /tmp, maybe a few more places. See here, this is essentially what the apt repo does:
Along with the next releases, we’ll add the caddy user to the www-data group so that should allow it to access more relevant locations on disk.
For now, I think you could create the /var/log/caddy directory and chown it to allow the caddy user to write there.