I noticed singularity in settings Caddyfile


(Dmitry Smirnov) #1

Hey!
I noticed singularity in settings Caddyfile.

When I write this syntax - everything is working:
localhost:8080 {
root /Users/root/workflow/site
}

if I write this syntax:
localhost:8080 {
root ~/workflow/site
}

I get 404 error.
Why not use an alias?
Because such a desire can appear not only for me. And this is not described in the docs and could complicate the search for errors.
Thanks for reading =)


(Matt Holt) #2

Simple: ~ is a bash expansion, it has nothing to do with Caddy.

You could use {$HOME} instead, since this is how Caddy parses env variables in the Caddyfile, but it is not bash, so tilde won’t be replaced with your home folder.


(Dmitry Smirnov) #3

Thank you Matt. I will be know :smile:


(system) #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.