Relative path in directive config

How is the correct behaviour for resolving a relative file name in a Caddyfile directive ?
I guess, the user would expect to specify it relative to the Caddyfile, right? How can I get this directory while parsing the directive config, then?

Context: Within my loginsrv directive, I want for configure the path to an additional file containing a whitelist with redirect hosts.

For something like that, I would expect Caddy to resolve relative paths from the working directory you run Caddy from.

The Caddyfile itself isn’t used to indicate the working directory, but they may be the same if you run Caddy from the same location (the PWD is one of the places Caddy checks for a Caddyfile to load).

Ok, thanks, than I will do it this way.

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