SabreDAV + Nginx + PUT (creates 0 byte file)

2019-06-05 09:07发布

问题:

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

  • Github Kohana module: https://github.com/chrisgo/kohana-sabredav
  • More notes: http://forum.kohanaframework.org/discussion/11991/webdav-module#Item_9
  • How do I allow a PUT file request on Nginx server?

回答1:

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