nginx-7-操作-接收put请求

1、编译 --with-http_dav_module   ex: --prefix=/usr/local/Nginx-1.8 --with-http_stub_status_module --with-pcre=/home/judy/install/Nginx/pcre-8.44 --with-http_sub_module --add-module=/home/judy/install/Nginx/Nginx-delay-module-master --with-http_ssl_module --with-http_dav_module   2、配置
server {
    listen 81;
    server_name localhost;
    ....
    location / {
        root html/put;
        dav_methods PUT DELETE;
        create_full_put_path on;
        client_max_body_size 600m;
        dav_access group:rw all:r;
        allow 172.16.201.0/24;
        deny all;
    }
}

说明:
dav_methods PUT; #允许特定的HTTP 和 WebDAV 方法
create_full_put_path on; #可以创建所以需要的中间目录
dav_access group:rw all:r; # 对最近创建的文件和目录设置访问权限
allow 6.6.6.6; #增加访问控制 deny all;
  3、验证 (1)curl做客户端 curl -X PUT -H 'Content-Type: application/x-mpegurl' -d 'licaizaixian_sd.ts' http://172.16.201.7:81/aaa -d:data,Nginx生成文件名为“aaa”,内容为“licaizaixian_sd.ts”   (2)jmeter为客户端 将本地文件put到Nginx

 

 

 

 

 

 

 

 

   

4、debug:

debug:put大文件时,Nginx返回413 Request Entity Too Large =》增加配置:client_max_body_size 1g;

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...