1

I'm trying to get SabreDAV and Nginx to work but it is creating a ZERO byte file (using Cyberduck as my DAV client). The file gets created but no content (so basically like a touch) The HTML frontend plugin uploads fine so I think the file permissions are OK. I can't seem to figure out how to get debug info out of SabreDAV (without hacking the code)

I've tried enabling the http_dav_module (not really sure if this is relevant)

sudo nginx -V

configure arguments: 
--prefix=/usr/share/nginx 
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-pcre-jit --with-debug --with-file-aio --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-mail --with-mail_ssl_module --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-auth-pam --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-dav-ext-module --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-echo --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-upstream-fair --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-syslog --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-cache-purge --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/ngx_http_pinba_module --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/ngx_http_substitutions_filter_module --add-module=/usr/src/nginx/source/nginx-1.4.2/debian/modules/nginx-x-rid-header --with-ld-opt=-lossp-uuid

and

server {
    ...
    # DAV
    client_body_temp_path       /tmp;
    dav_methods                 PUT DELETE MKCOL COPY MOVE;
    create_full_put_path        on;
    dav_access                  group:rw  all:r;
    ...
}

restart nginx

Community
  • 1
  • 1
Chris Go
  • 599
  • 6
  • 19
  • Not sure how to do a bounty here so I just posted a job at odesk: https://www.odesk.com/jobs/~~60b32f11a9e6c707 – Chris Go Dec 14 '13 at 20:35

1 Answers1

2

SabreDAV handles all the DAV methods. You must turn off nginx's dav module completely for it to work.

Evert
  • 93,428
  • 18
  • 118
  • 189
  • It looks like the proper directive is `dav_methods off;` (commented other directives for good measure, then restart) but it's still giving me the 0 byte file. Is there a better way of turning **OFF** nginx dav module? – Chris Go Dec 14 '13 at 05:40
  • What's more maddening is the client (Cyberduck) is reporting like everything works: image1.pdf upload complete 63.9 KB of 63.9 KB but it is a 0 byte file still – Chris Go Dec 14 '13 at 05:48
  • Turning off the nginx dav module now gives the error message: `I/O Error: Upload failed Not Allowed` (from Cyberduck) - this was the error message I was getting and why I tried to turn on nginx dav module. – Chris Go Dec 14 '13 at 19:32
  • On another note, while I was debugging the 0-byte file (with the nginx dav module turned on), sabredav seems to be getting triggered (not sure) and the file was getting created in whatever is set in `$server->setBaseUri()` so uploading/PUT a file called `a.png` on `/webdav` (baseUri) was creating a normal file (not zero bytes) in `/webdav/a.png` in the docroot (includes the full path and file name). The side reaction is that my http://.../webdav on the next hit is trying to pull up a directory index in that directory which results in a Forbidden 403 (basically killing my other routing) – Chris Go Dec 14 '13 at 19:37