cookbook 'ngx', '= 2.2.1'
ngx (16) Versions 2.2.1 Follow0
Install and configure nginx web server
cookbook 'ngx', '= 2.2.1', :supermarket
knife supermarket install ngx
knife supermarket download ngx
ngx cookbook
Chef cookbook to to install and configure nginx web server.
Concept
This cookbook provides a set of LWRPs to install and configure nginx web server, namely nginx_configure
, nginx_install
, nginx_module
, nginx_conf
, nginx_include
and nginx_vhost
. The first three have to do with building nginx from source, the other help with web server configuration. This is a minimal set that should be extended in order to support building nginx with extra modules (both standard and custom ones). One may take a look at ngx-modules repository, which provides examples on how this set can be utilized.
Usage
# instruct Chef to build nginx with http_gzip_static module nginx_module 'http_gzip_static' do flags %w[--with-http_gzip_static_module] action :add end # install nginx nginx_install 'default' do with_threads true directives( main: { worker_processes: 'auto' }, events: { worker_connections: 1024 }, http: { sendfile: 'on' } ) action :run end # create http_gzip_static config at /etc/nginx/conf.d nginx_conf 'http_gzip_static' do template 'http_gzip_static.conf.erb' action :create end # create an include file at /etc/nginx/includes nginx_include 'favicons' do template 'favicons.erb' variables server_name: 'www.acme.corp' action :create end # create a vhost file at /etc/nginx/sites-available # enable it by creating a symlink at /etc/nginx/sites-enabled nginx_vhost 'acme.corp' do template 'acme.corp.conf.erb' end
templates/default/http_gzip_static.conf.erb
gzip_static on;
templates/default/favicons.erb
location = /favicon.ico {
root /path/to/my/favicons;
}
templates/default/acme.corp.conf.erb
```
server {
server_name <%= @server_name %>;
listen 80;
include /etc/nginx/includes/favicons;
location / {
...
}
}
```
License
MIT @ Alexander Pyatkin
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog
and this project adheres to Semantic Versioning.
[2.2.1] - 2020-08-11
Fixed
- Fixed Nginx configuration dir permissions.
Added
- Introduced a new
nginx_install
resource property:error_log_options
, which enables changing Nginx error_log level for the main context.
[2.2.0] - 2020-07-05
Changed
- Update Nginx version to 1.19.0.
Removed
- Remove
with_ipv6
property fromnginx_install
resource.
[2.1.2] - 2019-10-28
Changed
- Update Nginx version to 1.17.5.
[2.1.1] - 2019-04-11
Added
- Introduced a new
nginx_install
resource property:pid
, which allows to control PID file location.
[2.1.0] - 2019-04-10
Added
- Introduced a new
nginx_install
resource property:directives
, which allows to write directives into the main Nginx configuration file. - Introduced a new
nginx_install
resource property:manage_user
, which allows to skip creating a separate user for Nginx web server and to use a provided one instead.
Changed
- Write some resource properties to
node.run_state['nginx']
so that they can be reused in other resources (e.g.log_dir
).
[2.0.0] - 2019-04-04
Changed
Major redesign. From now on this cookbook does not wrap nginx cookbook and provides a set of LWRPs instead.
[1.2.1] - 2019-02-04
Changed
- Ensure GeoLite2 databases are always up-to-date.
[1.2.0] - 2019-01-27
Added
- Add
ngx_http_gzip_static_module
module. - Add
ngx_brotli
module.
Changed
- Update nginx mainline version to 1.15.8 and stable version to 1.14.2.
- Update GeoLite2 database file checksums.
- Update OpenSSL and njs versions.
- Change
main_ext
log_format name tocombined_ext
.
Removed
- Remove nginx-ct module.
[1.1.1] - 2018-09-09
Changed
- Update nginx mainline version to 1.15.3.
- Update GeoLite2 database file checksums.
[1.1.0] - 2018-08-17
Changed
- Update nginx mainline version to 1.15.2.
- Update njs version to 0.2.3.
- Update OpenSSL version to 1.1.0i.
- Update
ngx_http_geoip2_module
version to 3.0. -
with_ct
option is nowfalse
by default. -
with_headers_more
option is nowfalse
by default.
[1.0.3] - 2018-08-05
Added
- Add
main_ext
log format (suitable for Nginx Amplify agent)
[1.0.2] - 2018-06-15
Added
- Support compiling nginx with ngx_http_lua_module.
[1.0.1] - 2018-06-14
Added
- Add a CHANGELOG file.
- Add
ngx:test
recipe so as to verifynginx -V
output during Kitchen tests. - Support compiling nginx with ngx_devel_kit module.
[1.0.0] - 2018-06-11
First appearance in public.
Added
- Upload the cookbook to Chef Supermarket.
Deprecated
- The project supersedes modern_nginx.
Collaborator Number Metric
2.2.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
2.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.2.1 failed this metric
FC108: Resource should not define a property named 'name': ngx/resources/conf.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/include.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/install.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/module.rb:3
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.2.1 passed this metric
Testing File Metric
2.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.1 passed this metric
2.2.1 failed this metric
2.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.2.1 failed this metric
FC108: Resource should not define a property named 'name': ngx/resources/conf.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/include.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/install.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/module.rb:3
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.2.1 passed this metric
Testing File Metric
2.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.1 passed this metric
2.2.1 failed this metric
FC108: Resource should not define a property named 'name': ngx/resources/include.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/install.rb:3
FC108: Resource should not define a property named 'name': ngx/resources/module.rb:3
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
2.2.1 passed this metric
Testing File Metric
2.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.1 passed this metric
2.2.1 failed this metric
2.2.1 passed this metric