Hi. Welcome!
1. The problem I’m having:
I try to configure caddy fileserver but I have 404 error.
I use the url: https://mydomain.duckdns.org/index.html
And I have on server the file in the path: /srv/www/index.html
I gave the permissions with: chmod -r 777 /srv/
My conf is:
{
debug
}
https://mydomain.duckdns.org {
root * /srv/www
file_server browse
}
2. Error messages and/or full log output:
in the log I have:
{“remote_ip”:“xxx.xxx.xxx.xxx”,“remote_port”:“38585”,“client_ip”:“xxx.xxx.xxx.xxx”,“proto”:“HTTP/2.0”,“method”:“GET”,“host”:“mydomain.duckdns.org”,“uri”:“/index.html”,“headers”:{“Accept-Encoding”:[“gzip, deflate, br, zstd”],“Sec-Fetch-Dest”:[“document”],“Accept-Language”:[“it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7”],“Sec-Fetch-User”:[“?1”],“Priority”:[“u=0, i”],“Sec-Fetch-Site”:[“none”],“Sec-Fetch-Mode”:[“navigate”],“Dnt”:[“1”],“Sec-Ch-Ua”:[“"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"”],“Sec-Ch-Ua-Platform”:[“"Windows"”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7”],“Sec-Ch-Ua-Mobile”:[“?0”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36”],“Upgrade-Insecure-Requests”:[“1”],“Cache-Control”:[“max-age=0”]},“tls”:{“resumed”:false,“version”:772,“cipher_suite”:4867,“proto”:“h2”,“server_name”:“mydomain.duckdns.org”}},“duration”:0.000068157,“status”:404,“err_id”:“zc06rf35m”,“err_trace”:“fileserver.(*FileServer).notFound (staticfiles.go:705)”}
I see in the log when start caddy:
{“level”:“debug”,“ts”:1738601880.577652,“logger”:“http.auto_https”,“msg”:“adjusted config”,“tls”:{“automation”:{“policies”:[{}]}},“http”:{“servers”:{“remaining_auto_https_redirects”:{“listen”:[“:80”],“routes”:[{},{}]},“srv0”:{“listen”:[“:443”],“routes”:[{“handle”:[{“handler”:“subroute”,“routes”:[{“handle”:[{“handler”:“vars”,“root”:“/srv/www”},{“browse”:{},“handler”:“file_server”,“hide”:[“/config/Caddyfile”]}]}]}],“terminal”:true}],“tls_connection_policies”:[{}],“automatic_https”:{}}}}}
3. Caddy version:
Add-on: Caddy 2
Open source web and proxy server with automatic HTTPS
Add-on version: 2.0.2
You are running the latest version of this add-on.
System: Home Assistant OS 14.2 (amd64 / qemux86-64)
Home Assistant Core: 2025.1.4
Home Assistant Supervisor: 2024.12.3
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to DEBUG
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service caddy: starting
s6-rc: info: service caddy successfully started
s6-rc: info: service legacy-services: starting
INFO: Prepare Caddy…
INFO: Checking path: /config/caddy
s6-rc: info: service legacy-services successfully started
INFO: Use built-in Caddy
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
4. How I installed and ran Caddy:
Run Caddy with HomeAssistant AddOn
a. System environment:
Home Assistant OS 14.2 (amd64 / qemux86-64)