ubuntu – Upload file with Nginx (WebDAV) with CURL
I am trying to upload files from local directory to Nginx server via WebDAV. I’ve already installed nginx-extras and --with-http_dav_module is enabled.
Here is my conf (based on many answers on Stackoverflow before):
root /home/computer/nginx;
index index.html index.htm index.nginx-debian.html;
server_name _;
location ~ "/upload/([0-9a-zA-Z-.]*)$" {
dav_methods PUT DELETE MKCOL COPY MOVE;
client_body_temp_path /tmp/nginx;
alias /home/computer/nginx/upload/$1;
create_full_put_path on;
dav_access group:rw all:r;
client_body_in_file_only on;
client_body_buffer_size 128k;
client_max_body_size 10G;
}
I want to upload an image from my local directory /home/computer/img/1.jpg to nginx (without any auth). When I run command I found from many answers on Stackoverflow,
curl -t "/home/computer/img/1.jpg" http://192.168.10.1/upload/1.jpg ,
it doesn’t upload file 1.jpg to nginx. If I manually put a different image to /home/computer/nginx/upload/1.jpg (nginx root), then I run command again, it shows content of that file instead of the image I want to upload.
Any solutions about that problem?
Read more here: Source link
