diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-09-15 11:57:29 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-09-15 11:57:29 +0000 |
commit | 04c2f085f4f7de40dec3417a40854636a908dc05 (patch) | |
tree | 972de3a8870d36dafda2b395a91a29ead0615d59 /src | |
parent | 4428cfc12b40527e4f2a085d1e5863e905c34779 (diff) | |
download | nginx-04c2f085f4f7de40dec3417a40854636a908dc05.tar.gz nginx-04c2f085f4f7de40dec3417a40854636a908dc05.zip |
nginx always sent "Vary: Accept-Encoding",
if both gzip_static and gzip_vary were on
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_gzip_static_module.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c index 19e412841..8080d9cb0 100644 --- a/src/http/modules/ngx_http_gzip_static_module.c +++ b/src/http/modules/ngx_http_gzip_static_module.c @@ -95,7 +95,13 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r) 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; } @@ -116,8 +122,6 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r) 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 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r) case NGX_ENOTDIR: case NGX_ENAMETOOLONG: + r->gzip = 0; return NGX_DECLINED; case NGX_EACCES: |