nginx fails to deliver certain files with gzip + SSL

Igor Sysoev is at rambler-co.ru
Mon Oct 29 19:45:07 MSK 2007


On Mon, Oct 29, 2007 at 10:54:39AM +0100, Joshua Sierles wrote:

> I've noticed a problem with nginx 0.6.x running with gzip and SSL.  
> Some static file delivery is cut off half way. This file always  
> breaks, for example:
> 
> http://prototypejs.org/assets/2007/10/16/prototype.js
> 
> Here is the relevant nginx config:
> 
>   gzip            on;
>   gzip_http_version 1.0;
>   gzip_comp_level 2;
>   gzip_proxied any;
>   gzip_types      text/plain text/html text/css application/x- 
> javascript text/xml application/xml application/xml+rss text/javascript;
> 
> server {
> 
>   root /Users/joshua/ssl-test;
>   listen 443;
>   ssl on;
>   # path to your certificate
>   ssl_certificate /Users/joshua/.ssl/server.crt;
>   # path to your ssl key
>   ssl_certificate_key /Users/joshua/.ssl/server.key;
> }

Try the attached patch.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/modules/ngx_http_gzip_filter_module.c
===================================================================
--- src/http/modules/ngx_http_gzip_filter_module.c	(revision 928)
+++ src/http/modules/ngx_http_gzip_filter_module.c	(working copy)
@@ -837,7 +837,10 @@
             }
         }
 
-        if (last == NGX_AGAIN && !ctx->done) {
+        if (last == NGX_AGAIN
+            && !ctx->done
+            && !(r->connection->buffered & NGX_LOWLEVEL_BUFFERED))
+        {
             return NGX_AGAIN;
         }
 


More information about the nginx mailing list