【发布时间】:2019-04-30 00:33:16
【问题描述】:
我正在尝试在 nginx 中设置一个 webdav 文件夹,其中只有一个用户可以写入/删除/创建,但匿名用户可以读取。
我的文件夹的 nginx 配置如下所示:
location /webdav/joe/ {
client_body_temp_path /tmp;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
limit_except GET PROPFIND OPTIONS { }
create_full_put_path on;
dav_access user:rw group:rw all:r;
fancyindex on;
fancyindex_exact_size off;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/auth/joe;
}
上面正确地限制了对 joe 的访问(joe 是包含用户 joe 的 httppasswd 文件)。但不能通过 http,提示密码,所以只对 joe 有效。
【问题讨论】: