下载资源
git clone https://github.com/arut/nginx-dav-ext-module
wget -c http://nginx.org/download/nginx-1.22.0.tar.gz
部署:
yum install gcc libgcc zlib-devel pcre-devel wget make git libxml2-devel libxslt-devel -y
tar -xvf nginx-1.22.0.tar.gz
cd nginx-1.22.0
./configure --prefix=/usr/local/nginx --with-http_dav_module --add-module=../nginx-dav-ext-module
make && make install
修改配置文件:
location / { root html; index index.html index.htm; autoindex on; autoindex_exact_size off; autoindex_localtime on; dav_methods PUT DELETE MKCOL COPY MOVE; #dav 模块功能上传,删除,移动等操作 create_full_put_path on; #支持上传目录 dav_ext_methods PROPFIND OPTIONS; dav_access user:rw group:r all:r; #设置访问权限 auth_basic "Authorized Users Only"; #设置访问认证 auth_basic_user_file /usr/local/nginx/conf/.passwd; }
启动:
/usr/local/nginx/sbin/nginx
利用代有dav功能的工具测试例如winscp