{ yeah : 必须哒 } No place to place should record our youth?

30Aug/100

Nginx+php下用Content-Length替换chunk编码模式方法

Posted by ofeng

1.修改nginx配置文件,gzip:off

2.php程序文件中,输出时加一个头参数

Header(“Content-lenth: $output_length\r\n”);

3.搞定!

没看过Nginx的源码,猜想了下Nginx的处理流程

   1: if( gzip on ){

   2:     chunk;

   3: }

   4: else {

   5:     if( has content-lenth ) {

   6:         content-lenth;

   7:     }

   8:     else {

   9:         chunk

  10:     }

  11: }