配置如下:
location / {
create_full_put_path on;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
charset utf-8;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
dav_access user:rw group:rw all:r;
client_body_temp_path /tmp/nginx/client-bodies;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
root /data/;
}
error log:
[error] 136638#0: *26 mkdir() "/data/webdav/obsidian/_posts/.obsidian" failed (17: File exists), client: xxxx, server: xxxxx, request: "MKCOL /webdav/obsidian/_posts/.obsidian/ HTTP/2.0", host:xxxx
obsidian, webDAV, Nginx, posts