Write only Nginx WebDAV configuration
I want to create a write only WebDAV location / feature for Nginx. Currently I have the following configuration file (relevant part only).
location ~ "/webdav/([0-9a-zA-Z-.]*)$" {
alias /storage/www/webdav/$1;
client_body_temp_path /tmp/upl_tmp;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access group:rw all:r;
}
If someone wants to upload a file they can through curl.exe -T foo.txt https://webserver.com/webdav/foo.txt
. This will be stored in the /storage/www/webdav
directory, outside of the typical webroot (/var/www/html
).
The problem (for me) is they can still access it at https://webserver.com/webdav/foo.txt
after the upload. I want a write only configuration, so the behavior is the same, but the user cannot access the file after uploading.
I’ve attempted to modify the dav_access
permissions, but Nginx seems to thing that only having write permissions (no read) is invalid.
Any idea on how I can achieve this?
Thanks.
Read more here: Source link