Please don’t forget to make a volume for /data
! See the notes on Docker
I think the problem you’re having is with the directive order of the directives you defined. The Caddyfile sorts directives according to this predetermined order:
But I think what you want to do would be easier to implement by constructing the path inside your template file, similarly to how the Caddy docs do it.
See the index.html
from the docs site, and its Caddyfile
, as noted in the example for templates
in the docs: