nginx is a very widespread high-performance Web server. There are two nginx modules that provide basic WebDAV support:
- ngx_http_dav_module (PUT, DELETE, MKCOL, COPY, MOVE)
- nginx-dav-ext-module (PROPFIND, OPTIONS)
Sample configuration
WebDAV configuration within a virtual host may look like this:
(nginx vserver) { # workaround for https://trac.nginx.org/nginx/ticket/1966 location ^~ /dav/ { if ($request_method = MKCOL) { rewrite ^(.*[^/])$ $1/ break; } # required WebDAV methods dav_methods PUT DELETE MKCOL COPY MOVE; dav_ext_methods PROPFIND OPTIONS; client_max_body_size 20M; create_full_put_path on; # file permissions (nginx user/group) dav_access user:rw group:rw all:r; # restrict access auth_basic "Authorized Users Only"; auth_basic_user_file $document_root/dav/.htaccess.basic; satisfy any; }
Make sure that the nginx process can write to the configured WebDAV directory (otherwise it will return HTTP 500 on write requests) and that access restrictions are working as expected.
WebDAV setup
You can access your files using the DAVx⁵ WebDAV mounts feature.
WebDAV URL: https://nginx.example.com/dav/
(according to your nginx config)
User name and password: according to your nginx config