1. Caddy version (caddy version
):
2.4.5
2. How I run Caddy:
Simply caddy run
for localhost-only testing right now – no domains.
a. System environment:
Windows 10 pre-compiled executable
b. Command:
caddy run
d. My complete Caddyfile or JSON config:
:8050 {
handle_path /photos {
file_server {
root "d:/photos"
browse
}
}
handle /videos {
file_server {
root "d:/videos"
browse
}
}
route /songs* {
file_server {
root "d:/songs"
browse
}
}
handle_path /documents* {
file_server {
root "d:/documents"
browse
}
}
handle /books* {
file_server {
root "d:/books"
browse
}
}
}
3. The problem I’m having:
I want /photos to be a file_server for the D:/Photos directory, /videos to be a file_server for the D:/Videos directory, and so on.
The above Caddyfile shows me trying different combinations of route
, handle
, and handle_path
, with wildcard and non-wildcard matchers, trying to see which would be appropriate for this situation; none are.
Some of them will show a file_server for the top-level directory, but fail to make subfolders navigable.
5. What I already tried:
Various combinations of handle
, handle_path
, route
, root directives, using :8050/books
, :8050/photos
etc as entirely different blocks… the only solution so far that’s worked is putting them on different ports.