Nginx WebDAV 지원

3009 단어
Nginx 가 WebDAV 를 지원 하려 면 http 를 추가 해 야 합 니 다.dav_module 모듈 지원.
Nginx 바 이 너 리 파일 다시 컴 파일 하기
#     ,  --with-http_dav_module  
bash-4.1# ./configure --prefix=/export/servers/nginx/ --user=admin --group=admin --with-http_dav_module

#          【           】
bash-4.1# ll /export/servers/nginx/sbin/nginx*
-rwxr-xr-x 1 root  root  3729261 11  24 13:30 /export/servers/nginx/sbin/nginx
-rwxr-xr-x 1 admin admin 3679011 11  10 07:55 /export/servers/nginx/sbin/nginx.old

Nginx 프로필 수정
     location /dav {
                #        root,           /export/Data/www/dav/   
        root                  /export/Data/www;
                #                
        client_body_temp_path /export/Data/client_temp;
                #      HTTP webdav  
                #        PUT         ,       remove
        dav_methods PUT DELETE MKCOL COPY MOVE;
                # webdav                。                
        create_full_put_path  on;
                #       
        dav_access            group:rw  all:r;
        limit_except GET {
            allow 127.0.0.1;
            deny  all;
        }
        }

웹 dav 사용 하기
bash-4.1# hostname > name.txt
bash-4.1# curl -T name.txt http://localhost/dav

409 Conflict

409 Conflict


nginx/1.14.1
# , name.txt dav , dav, dav 。 409 bash-4.1# cat /export/servers/nginx/logs/error.log 2018/11/24 13:55:34 [error] 8838#0: *13 "/export/Data/www/dav" could not be created (21: Is a directory), client: 127.0.0.1, server: blog.bgops.com, request: "PUT /dav HTTP/1.1", host: "localhost" # ok bash-4.1# curl -T name.txt http://localhost/dav/ bash-4.1# curl http://localhost/dav/name.txt 37f4f7fe8054 bash-4.1# cat /export/Data/www/dav/name.txt 37f4f7fe8054 bash-4.1# hostname -i >> name.txt bash-4.1# curl -T name.txt http://localhost/dav/ bash-4.1# curl http://localhost/dav/name.txt 37f4f7fe8054 172.17.0.2 # , 201; 204【 , 】 127.0.0.1 - - [24/Nov/2018:13:55:38 +0000] "PUT /dav/name.txt HTTP/1.1" 201 25 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" 127.0.0.1 - - [24/Nov/2018:13:58:21 +0000] "GET /dav/name.txt HTTP/1.1" 200 13 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" 127.0.0.1 - - [24/Nov/2018:13:58:56 +0000] "PUT /dav/name.txt HTTP/1.1" 204 25 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" 127.0.0.1 - - [24/Nov/2018:13:59:00 +0000] "GET /dav/name.txt HTTP/1.1" 200 24 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2"

좋은 웹페이지 즐겨찾기