I want Caddy to run as a file server for all disks: C:, D:\ and E:\ in Windows 10.
This is my present Caddyfile:
localhost
root * E:
file_server browse
And Caddy file server works great, for files on disk E:.
But I want other disks, namely C:\ and D:\ to be included in file share
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
My Caddyfile which works well for files on disk E:\ is:
localhost
root * E:
file_server browse
Not sure why \ must be left out?
I have tried, without success, the following:
localhost {
root * C:\
root * E:\
root * D:\
}
file_server browse
ALSO tried
localhost {
root * C:
root * E:
root * D:
}
file_server browse
But it also must be said, serving your entire system drive is a terrible idea for a variety of reasons (security etc). Be very careful when doing this.
produces blank HTML page. However, Caddy web server starts. I get this error:
Caddyfile input is not formatted; run the ‘caddy fmt’ command to fix inconsistencies {“adapter”: “caddyfile”, “file”: “Caddyfile”, “line”: 3}
Show a request with curl -v. Enable the debug global option and look at your logs. Please review the structure of the Caddyfile: Caddyfile Concepts — Caddy Documentation