nginx 支持chunked

http://www.weekface.info/2010/05/20/nginx

 

HTTP协议有一种分块传输编码的机制(Chunked Transfer Encoding),即一个HTTP消
息可以分成多个部分进行传输。它对HTTP请求和HTTP响应都是适用的, 我们在作这样一个项目的时候就遇到了这样的问题:J2ME作的客户端,server端是rails,但J2ME发送的HTTP request 的header Transfer-Encoding: chunked,即是以块传输的,Rails接受这样的数据有问题(报错:negative length -27 given),所以需要编译Nginx的时候处理下,要编译chunkin-nginx-module模块:

wget http://github.com/agentzh/chunkin-nginx-module/tarball/v0.19
tar zxvf agentzh-chunkin-nginx-module-cb610a5.tar.gz

然后再:

[root@li96-10 nginx-0.7.65]# ./configure --prefix=/usr/local/system/nginx --with-openssl=/usr/include --with-pcre=/usr/local/lib --with-http_stub_status_module --with-http_realip_module --add-module=/root/src/agentzh-chunkin-nginx-module-cb610a5
[root@li96-10 nginx-0.7.65]# vim objs/Makefile
./configure --disable-shared #注释掉这行内容
[root@li96-10 nginx-0.7.65]# make
[root@li96-10 nginx-0.7.65]# make install

下面来测试下安装:

[root@li96-10 nginx-0.7.65]# vim /usr/local/system/nginx/conf/nginx.conf
listen       8080; #暂时先改为8080端口
chunkin on; #打开chunkin模块
[root@li96-10 nginx-0.7.65]# /usr/local/system/nginx/sbin/nginx  #然后启动之
[root@li96-10 nginx-0.7.65]# ps aux | grep nginx
root     17379  0.0  0.1   3764   496 ?        Ss   11:44   0:00 nginx: master process /usr/local/system/nginx/sbin/nginx
nobody   17380  0.0  0.2   3932   848 ?        S    11:44   0:00 nginx: worker process             
root     17384  0.0  0.1   3916   692 pts/0    S+   11:44   0:00 grep nginx
posted on 2010-12-11 23:55  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2010/12/11/1903507.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值