Gzipping proxied content after using subs_filter fails

Maxim Dounin mdounin at mdounin.ru
Fri Aug 10 09:56:35 UTC 2012


Hello!

On Thu, Aug 09, 2012 at 05:28:06PM -0400, abstein2 wrote:

> As the title says, I'm having an issue with gzipping proxied web pages
> after using subs_filter. It doesn't always happen, but it looks like
> whenever a page exceeds the size of one of my proxy_buffers I get an
> error in the error log saying:
> 
> [alert] 18544#0: *490084 deflate() failed: 2, -5 while sending to
> client, client: xxx.xxx.xxx.xxx, server: www.test.com, request: "GET /
> HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:80/", host: "www.test.com",
> referrer: "http://xxx.xxx.xxx.xxx/"

Here nginx did deflate with Z_SYNC_FLUSH (2) and deflate() 
returned error Z_BUF_ERROR (-5, no progress possible).  The error 
message suggests you are using an old nginx, and subs filter 
somehow triggers the problem as fixed here:

http://trac.nginx.org/nginx/changeset/4469/nginx

Changes with nginx 1.1.15:

    *) Bugfix: calling $r->flush() multiple times might cause errors in the
       ngx_http_gzip_filter_module.

It's not clear why subs filter triggers flush (and does so twice in a row),
most likely it's a bug in subs filter (you may want to ask it's author), but
upgrading nginx to 1.1.15+ should resolve the problem.

[...]

Maxim Dounin



More information about the nginx mailing list