Http 403 permissions error

1. Caddy version (caddy version):

v2.4.3

2. How I run Caddy:

a. System environment:

Ubuntu 20.04 (LTS) x64

b. Command:

systemctl start caddy

d. My complete Caddyfile or JSON config:

subdomain.mydomain.com {
    root * /path/to/folder/
    file_server browse
}

3. The problem I’m having:

When I try visit subdomain.mydomain.com I get a HTTP403 error rather than a file browser. I have added caddy to the root group with usermod -a -G root caddy but still no luck

Turn on debug mode in Caddy:

{
	debug
}

What do you see in your logs? You can find them with journalctl -u caddy --no-pager | less (and hit Shift+G to jump to the end of the logs).

You should not add caddy to the root group, that’s not a good idea. Instead, make sure that your site root is either owned by caddy or group-owned by www-data.

2 Likes

Cool I removed caddy from that group and made it the owner of /path/

Jul 28 17:24:57 grv caddy[53917]: {"level":"debug","ts":1627493097.0220857,"logger":"tls","msg":"loading managed certificate","domain":"subdomain.mydomain.com","expiration":1635258290,"issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Jul 28 17:24:57 grv caddy[53917]: {"level":"info","ts":1627493097.0229893,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Jul 28 17:24:57 grv systemd[1]: Started Caddy.
Jul 28 17:24:57 grv caddy[53917]: {"level":"info","ts":1627493097.0259213,"msg":"serving initial configuration"}
Jul 28 17:25:04 grv caddy[53917]: {"level":"debug","ts":1627493104.2423012,"logger":"http.handlers.file_server","msg":"sanitized path join","site_root":"/path/to/folder","request_path":"/","result":"/path/to/folder"}

This topic was automatically closed after 30 days. New replies are no longer allowed.