nginx架设HTTP服务器接受PUT方法上传文件

最近用nginx架了个http服务器,通过http上传文件。
nginx的配置如下:

        location ~ ^/wraith {
            root /data/tmp;
            dav_methods PUT;
            dav_access user:r group:r all:r;
            create_full_put_path on;

            limit_except GET {
            }
        }

如上,子目录/wraith将接受PUT方法。

$curl -XPUT --data-binary @${TAR_PATH} --noproxy '*'  http://xxx.xxx.xxx.xxx/wraith/${TAR_FILE}

如上用curl通过http上传文件到服务器的/data/tmp目录下,文件命名为${TAR_FILE}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.