Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx cookbook v 2.0.0: Cookbook http_gzip_static_module not found

I'm using berkshelf to manage cookbooks, chef 11.6.2, and nginx cookbook v 2.0.0

my settings to compile nginx from source:

set[:nginx][:source][:modules] = ["http_gzip_static_module", "http_ssl_module"]

The provisioning gives me the error:

Cookbook http_gzip_static_module not found. If you're loading http_gzip_static_module from another cookbook, make sure you configure the dependency in your metadata

Is it a bug from nginx cookbook and how do you solve it? Everything works well with nginx cookbook v 1.7.0

Many thanks.

like image 692
DungHuynh Avatar asked Oct 22 '13 15:10

DungHuynh


People also ask

What is the ngx_http_gzip_module Module?

The ngx_http_gzip_module module is a filter that compresses responses using the “gzip” method. This often helps to reduce the size of transmitted data by half or even more. When using the SSL/TLS protocol, compressed responses may be subject to BREACH attacks. The $gzip_ratio variable can be used to log the achieved compression ratio.

When to use gzipped file in NGX?

With the “ always ” value (1.3.6), gzipped file is used in all cases, without checking if the client supports it. It is useful if there are no uncompressed files on the disk anyway or the ngx_http_gunzip_module is used.

How to enable/disable the gzip_static_module?

This module is not built by default, it should be enabled with the --with-http_gzip_static_module configuration parameter. Enables (“ on ”) or disables (“ off ”) checking the existence of precompressed files.

How to compress uncompressed files in NGX?

It is useful if there are no uncompressed files on the disk anyway or the ngx_http_gunzip_module is used. The files can be compressed using the gzip command, or any other compatible one. It is recommended that the modification date and time of original and compressed files be the same.


1 Answers

The nginx cookbook version was increased to 2.0.0 to make an emphasis on breaking changes. Particularly now you should specify all modules with nginx:: prefix and do not use extra_modules at all. So, it should look like this now:

"default_attributes": {
    "nginx": {
      "source": {
        "modules": [
          "nginx::http_gzip_static_module", "nginx::http_ssl_module",
          "nginx::http_realip_module", "nginx::http_stub_status_module",
          "nginx::upload_progress_module"]
        }
    }
}

Please look at this ticket and relevant changeset for details.

like image 111
mike_k Avatar answered Oct 20 '22 16:10

mike_k