nginx-7-操作-接收put请求
时间:2020-09-11 19:46:44
收藏:0
阅读:195
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;
原文:https://www.cnblogs.com/yajun2019/p/13653313.html
评论(0)