gzip min_length with upstream + ssi

191919 191919 at gmail.com
Thu Sep 17 13:51:33 MSD 2009


Hi there,

I encountered a problem when using gzip_min_length with upstream + ssi:

ssi on;
gzip_min_length 1024;
upstream fastcgi_backends
{
  server unix:/tmp/nx-fastcgi.sock.00;
}

I wrote a PHP script as:

<?
header('Content-Length: 3');
echo '123';
?>

and requested as:

GET /2.php HTTP/1.0
Accept-Encoding: gzip, deflate

nginx returned:

HTTP/1.1 200 OK
Server: nginx/0.8.15
Date: Thu, 17 Sep 2009 09:39:57 GMT
Content-Type: text/html
Connection: close
X-Powered-By: PHP/5.2.8
Vary: Accept-Encoding
Content-Encoding: gzip

3426???

As you see, the content is compressed despite of gzip_min_length = 1024.

When I turned off ssi (ssi off;), gzip_min_length works:

HTTP/1.1 200 OK
Server: nginx/0.8.15
Date: Thu, 17 Sep 2009 09:48:11 GMT
Content-Type: text/html
Connection: close
X-Powered-By: PHP/5.2.8
Content-Length: 3
Vary: Accept-Encoding

123

(Commenting out "ngx_http_clear_content_length(r);" in
ngx_http_ssi_filter_module.c also works, I didn't test whether ssi still
worked.)

Regards,
jh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090917/f986fb82/attachment.html>


More information about the nginx mailing list