This package implements a simple WebDAV handler module for Caddy.
Requires Caddy 2+.
webdav [<matcher>] {
root <path>
prefix <request-base-path>
}
Because this directive does not come standard with Caddy, you need to put the directive in order. The correct place is up to you, but usually putting it at the end works if no other terminal directives match the same requests:
{
order webdav last
}
The prefix
directive is optional but has to be used if a webdav share is used in
combination with matchers or path manipulations. This is because webdav uses
absolute paths in its response. There exist a similar issue when using reverse
proxies, see
The "subfolder problem", OR, "why can't I reverse proxy my app into a subfolder?".
webdav /some/path/match/* {
root /path
prefix /some/path/match
}
Special thanks to @hacdias for making caddy-webdav for Caddy 1, from which this work is derived: https://github.com/hacdias/caddy-webdav