Skip to content

About

nginx module for extended WebDAV methods (PROPFIND, OPTIONS, LOCK, UNLOCK)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

nginx-dav-ext-module

Build&Test WebDAV FreeBSD A/UBSan Valgrind Reload CodeQL Lint

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:

  • PROPFIND and OPTIONS, with the directory listing returned as a multistatus document;
  • LOCK and UNLOCK, backed by a shared memory lock zone.

Synopsis

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;
        }
    }
}

Directives

  • 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 the http block.
  • dav_ext_lock zone=<name>: enable LOCK/UNLOCK in this location using that zone.

The module links libxml2 and libxslt (through nginx's LIBXSLT), which the PROPFIND response is built with.

Building

The standard dav module has to be in the build as well:

./configure --with-http_dav_module --add-module=/path/to/nginx-dav-ext-module

or as a loadable module

./configure --with-http_dav_module \
    --add-dynamic-module=/path/to/nginx-dav-ext-module

with load_module modules/ngx_http_dav_ext_module.so; in the main context.

Testing

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/nginx

The 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.

License

BSD 2-Clause, see LICENSE.

About

nginx module for extended WebDAV methods (PROPFIND, OPTIONS, LOCK, UNLOCK)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages