The standard nginx ngx_http_dav_module implements only part of WebDAV:
GET, HEAD, PUT, DELETE, MKCOL, COPY and MOVE. This module adds the missing
methods on top of it, so the two together give a working WebDAV server:
PROPFINDandOPTIONS, with the directory listing returned as amultistatusdocument;LOCKandUNLOCK, backed by a shared memory lock zone.
http {
dav_ext_lock_zone zone=davlock:10m timeout=30s;
server {
location / {
root /var/www/dav;
# the standard module provides these
dav_methods PUT DELETE MKCOL COPY MOVE;
# this module adds these
dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
dav_ext_lock zone=davlock;
}
}
}dav_ext_methods [PROPFIND] [OPTIONS] [LOCK] [UNLOCK]: which of the extra methods to handle in this location.dav_ext_lock_zone zone=<name>:<size> [timeout=<time>]: a shared memory zone that holds the locks, declared in thehttpblock.dav_ext_lock zone=<name>: enableLOCK/UNLOCKin this location using that zone.
The module links libxml2 and libxslt (through nginx's LIBXSLT), which the
PROPFIND response is built with.
The standard dav module has to be in the build as well:
./configure --with-http_dav_module --add-module=/path/to/nginx-dav-ext-moduleor as a loadable module
./configure --with-http_dav_module \
--add-dynamic-module=/path/to/nginx-dav-ext-modulewith load_module modules/ngx_http_dav_ext_module.so; in the main context.
ci/build.sh 1.30.5 /tmp/nginx-test
TEST_NGINX_BINARY=/tmp/nginx-test/sbin/nginx prove -r t/
ci/dav_ext.sh /tmp/nginx-test/sbin/nginx
ci/reload.sh /tmp/nginx-test/sbin/nginxThe t/ suite needs the Perl module HTTP::DAV; the nginx core
Test::Nginx is vendored under t/lib. ci/dav_ext.sh needs only
curl and drives the methods end to end, including the lock, unlock and
relock cycle that HTTP::DAV cannot.
BSD 2-Clause, see LICENSE.