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
    
  • 相关阅读:
    十三 .Django(ORM表高级操作)
    十二 .Django ForeighKey自关联(ORM)
    十二 .Django 一对多表ForeighKey(ORM)
    十一 .Django 一对一表OneToOneField (ORM)
    十 .Django 单表操作(ORM)
    八 .Django 模型(models)
    【模板】Lucas定理
    【模板】AC自动机加强版
    【模板】AC自动机
    【POJ3162】Walking Race 树形dp+单调队列+双指针
  • 原文地址:https://www.cnblogs.com/lexus/p/1903507.html
Copyright © 2011-2022 走看看