1. Caddy version:
caddy v2.6.4
2. How I installed, and run Caddy:
apt install caddy
a. System environment:
ubuntu jammy x64
b. Command:
systemd
c. Service/unit/compose file:
systemd service file not modified
d. My complete Caddy config:
test.domain.foo {
# Set this path to your site's directory.
root * /srv/www/test.domain.foo/wwwroot
import ./caddy.d/processwire.conf
# what I am trying 👇
handle_path /securefiles/* {
file_server /home/ubuntu/Data/SecureFiles
}
# Enable the static file server.
file_server
php_fastcgi 127.0.0.1:9000
tls root@domain.foo
}
3. The problem I’m having:
The root dir is /srv/caddy/test.domain.foo/wwwroot
and I would like to be able to read files from an absolute path stored outside the host directory, from /home/ubuntu/Data/SecureFiles/
What’s the right config to achieve it please ?
4. Error messages and/or full log output:
The following error come from the cmf, anyway, the dir /home/ubuntu/Data/SecureFiles/
is chmod’d to 777 for testing purpose, with the same user:group as caddy is running.
Secure File: Path '/' does not exist or is not writeable
5. What I already tried:
After reading some posts here, I tried to play with
handle_path /securefiles/* {
file_server /home/ubuntu/Data/SecureFiles
}