zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    T4设计时模板调试
    MVC开发T4代码生成之一文本模板基础
    经典选项卡
    IE 调试工具 Utilu IE Collection:IE5.5、6.0、7.0, 8.0…各版本浏览器兼容性测试工具
    滚动读行!
    自定义标签的用法、支持IE6
    jQuery 参数传递例子
    IMG在IE6下不能HOVER的解决办法!
    点击渐变弹出层
    操作滚动条滚动到指定位置
  • 原文地址:https://www.cnblogs.com/lexus/p/1903507.html
Copyright © 2011-2022 走看看