How to use the COPY method in WebDAV (nginx)?

There is the following problem:
When you try to copy a file to /from.png with cURL to another directory to COPY nginx complains.

The config of nginx:
location ~ ^/path/.+\.png {
 root /mnt/path/to/;
 client_max_body_size 2m;
 dav_methods PUT DELETE COPY;
 "create_full_put_path" on;
 dav_access group:rw all:r;
}


Here's a curl request is sent to ω (the output with the verbose parameter)
> COPY /path/dir/file.png HTTP/1.1
Host: localhost
Accept: */*
Destination: http://localhost/path/dir2/file2.png

< HTTP/1.1 500 Internal Server Error
< Server: nginx/1.10.0 (Ubuntu)
< Date: Fri, 25 Nov 2016 07:38:53 GMT
< Content-Type: text/html
< Content-Length: 202
< Connection: close
< 
* Closing connection 0


Error in log:
2016/11/25 14:38:53 [crit] 12205#12205: *626 open() "/mnt/path/to/path/dir2/file2.png" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "COPY /path/dir/file.png HTTP/1.1", host: "localhost"


Directory dir2 does not exist, is there a way to force nginx to create it and copy the file there?
July 2nd 19 at 14:23
1 answer
July 2nd 19 at 14:25
To use a PUT method DAV

curl -T '/path/to/local/file.txt' 'example.com/test'

Find more questions by tags Web DevelopmentNginxWebDAV