0

I have set the following configuration:

 location /upl {
       root /storage/www/upl/data;
       client_body_temp_path   /storage/www/upl/client_tmp;

       dav_methods  PUT DELETE MKCOL COPY MOVE;

       create_full_put_path   on;
       dav_access             group:rw  all:r;
  }

I upload a file with: curl -T test.txt http://x.xx.xx.xx:8080/upl

All of my files end up in data folder but all files have the same name "upl" the same as the location ?! Why :S

Please help

BR,

Lonko
  • 115
  • 1
  • 5

2 Answers2

3

You can do this by specifying filename into URL, without using any external module :

location ~ "/upl/([0-9a-zA-Z-.]*)$" {
        alias     /storage/www/upl/$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;
}

And use : curl -T test.txt http://x.xx.xx.xx:8080/upl/text.txt

0

According to Wikipedia, Nginx has a very limited optional WebDAV module and a third-party module, the ngx_http_dav_module.

Servers & Clients Supported

https://en.wikipedia.org/wiki/WebDAV

suchislife
  • 356
  • 4
  • 11
  • Thank you, found this also but don't think it applies as it is using proxypass for some backend. I don't have a backend i would like to have a normal http put file – Lonko Mar 10 '21 at 15:00