首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Nginx 在POST提交数据时,报 HTTP411 Content-Length required 错误

Nginx 在POST提交数据时,报 HTTP411 Content-Length required 错误

作者头像
EltonZheng
发布2021-01-26 10:11:53
发布2021-01-26 10:11:53
1.5K0
举报

在使用Nginx 1.3.9以下版本,都存在当用户POST一个带有文件的请求的时候,出现HTTP 411错误。

这个是Nginx的问题,需要打一个补丁。https://github.com/agentzh/chunkin-nginx-module

代码语言:javascript
复制
#下载chunkin模块
git clone https://github.com/agentzh/chunkin-nginx-module.git

#编译nginx,使用chunkin模块
wget http://nginx.org/download/nginx-1.2.7.tar.gz
tar xvzf nginx-1.2.7.tar.gz
cd nginx-1.2.7
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --with-google_perftools_module --with-http_realip_module --add-module=../chunkin-nginx-module 

make -j8
make install

然后在nginx.conf中添加

代码语言:javascript
复制
chunkin on;
 
  error_page 411 = @my_411_error;
  location @my_411_error {
      chunkin_resume;
  }

之后重启nginx就可以了。


本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档