Welcome! Log In Create A New Profile

Advanced

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

September 15, 2009 08:46AM
On Tue, Sep 15, 2009 at 02:05:35PM +0400, Igor Sysoev wrote:

> On Tue, Sep 15, 2009 at 01:54:53PM +0400, Igor Sysoev wrote:
>
> > On Tue, Sep 15, 2009 at 06:33:38PM +0900, Zev Blut wrote:
> >
> > > Hello,
> > >
> > >
> > > On 09/15/2009 05:23 PM, Igor Sysoev wrote:
> > > >On Tue, Sep 15, 2009 at 04:20:48PM +0900, Zev Blut wrote:
> > >
> > > >>I have attached a debug log from 0.6.39 that has the Vary when it should
> > > >>not. If you would like I can also attach a debug log from 0.6.32 that
> > > >>does not include the Vary (which is what I need).
> > > >
> > > >This bug was fixed in 0.7.9.
> > > >The attached patch fixes it in 0.6.x, if you prefer to stay on this
> > > >version.
> > >
> > > Thank you for the patch!
> > > Unfortunately, it nor does the latest 0.7.62 seem to fix it.
> > > I am still getting the Vary: Accept-Encoding header for non gzip stuff.
> > > In both this patch and with 0.7.62

> > I could not reproduce these responses on 0.8.15, 0.7.62 and patched 0.6.39.
> > Are you sure that you have no "image/png" in gzip_types ?
>
> Sorry, I missed "gzip_static on": it caused the problem.

The attached patch fixes this bug on 0.8.15 and 0.7.62.


--
Igor Sysoev
http://sysoev.ru/en/
Index: src/http/modules/ngx_http_gzip_static_module.c
===================================================================
--- src/http/modules/ngx_http_gzip_static_module.c (revision 2451)
+++ src/http/modules/ngx_http_gzip_static_module.c (working copy)
@@ -95,10 +95,16 @@

gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module);

- if (!gzcf->enable || ngx_http_gzip_ok(r) != NGX_OK) {
+ if (!gzcf->enable) {
return NGX_DECLINED;
}

+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+
+ if (clcf->gzip_vary && ngx_http_gzip_ok(r) != NGX_OK) {
+ return NGX_DECLINED;
+ }
+
log = r->connection->log;

p = ngx_http_map_uri_to_path(r, &path, &root, sizeof(".gz") - 1);
@@ -116,8 +122,6 @@
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
"http filename: \"%s\"", path.data);

- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
ngx_memzero(&of, sizeof(ngx_open_file_info_t));

of.directio = clcf->directio;
@@ -138,6 +142,7 @@
case NGX_ENOTDIR:
case NGX_ENAMETOOLONG:

+ r->gzip = 0;
return NGX_DECLINED;

case NGX_EACCES:
Subject Author Posted

Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 12:16AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Jeff Waugh September 15, 2009 12:54AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 01:44AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 01:52AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 08:46AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 08:46AM

Re: [BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut September 15, 2009 08:52AM

Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Igor Sysoev September 15, 2009 01:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready