Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ The following parameters are available in the `nginx` class:
* [`proxy_use_temp_path`](#-nginx--proxy_use_temp_path)
* [`proxy_connect_timeout`](#-nginx--proxy_connect_timeout)
* [`proxy_headers_hash_bucket_size`](#-nginx--proxy_headers_hash_bucket_size)
* [`proxy_headers_hash_max_size`](#-nginx--proxy_headers_hash_max_size)
* [`proxy_http_version`](#-nginx--proxy_http_version)
* [`proxy_read_timeout`](#-nginx--proxy_read_timeout)
* [`proxy_redirect`](#-nginx--proxy_redirect)
Expand Down Expand Up @@ -252,6 +253,8 @@ The following parameters are available in the `nginx` class:
* [`nginx_upstreams`](#-nginx--nginx_upstreams)
* [`nginx_upstreams_defaults`](#-nginx--nginx_upstreams_defaults)
* [`purge_passenger_repo`](#-nginx--purge_passenger_repo)
* [`variables_hash_bucket_size`](#-nginx--variables_hash_bucket_size)
* [`variables_hash_max_size`](#-nginx--variables_hash_max_size)

##### <a name="-nginx--include_modules_enabled"></a>`include_modules_enabled`

Expand Down Expand Up @@ -1112,6 +1115,14 @@ Data type: `Integer`

Default value: `64`

##### <a name="-nginx--proxy_headers_hash_max_size"></a>`proxy_headers_hash_max_size`

Data type: `Optional[Integer]`



Default value: `undef`

##### <a name="-nginx--proxy_http_version"></a>`proxy_http_version`

Data type: `Optional[String]`
Expand Down Expand Up @@ -1691,6 +1702,22 @@ Data type: `Boolean`

Default value: `true`

##### <a name="-nginx--variables_hash_bucket_size"></a>`variables_hash_bucket_size`

Data type: `Optional[Integer]`



Default value: `undef`

##### <a name="-nginx--variables_hash_max_size"></a>`variables_hash_max_size`

Data type: `Optional[Integer]`



Default value: `undef`

## Defined types

### <a name="nginx--resource--geo"></a>`nginx::resource::geo`
Expand Down
3 changes: 3 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
$proxy_use_temp_path = $nginx::proxy_use_temp_path
$proxy_connect_timeout = $nginx::proxy_connect_timeout
$proxy_headers_hash_bucket_size = $nginx::proxy_headers_hash_bucket_size
$proxy_headers_hash_max_size = $nginx::proxy_headers_hash_max_size
$proxy_http_version = $nginx::proxy_http_version
$proxy_max_temp_file_size = $nginx::proxy_max_temp_file_size
$proxy_read_timeout = $nginx::proxy_read_timeout
Expand Down Expand Up @@ -139,6 +140,8 @@
$worker_rlimit_nofile = $nginx::worker_rlimit_nofile
$pcre_jit = $nginx::pcre_jit
$include_modules_enabled = $nginx::include_modules_enabled
$variables_hash_bucket_size = $nginx::variables_hash_bucket_size
$variables_hash_max_size = $nginx::variables_hash_max_size

# Non-configurable settings
$conf_template = 'nginx/conf.d/nginx.conf.erb'
Expand Down
42 changes: 24 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
# @param proxy_use_temp_path
# @param proxy_connect_timeout
# @param proxy_headers_hash_bucket_size
# @param proxy_headers_hash_max_size
# @param proxy_http_version
# @param proxy_read_timeout
# @param proxy_redirect
Expand Down Expand Up @@ -216,6 +217,8 @@
# @param nginx_upstreams
# @param nginx_upstreams_defaults
# @param purge_passenger_repo
# @param variables_hash_bucket_size
# @param variables_hash_max_size
class nginx (
### START Nginx Configuration ###
Optional[Variant[Stdlib::Absolutepath, Tuple[Stdlib::Absolutepath, Integer, 1, 4]]] $client_body_temp_path = undef,
Expand Down Expand Up @@ -320,6 +323,7 @@
Optional[Enum['on', 'off']] $proxy_use_temp_path = undef,
Nginx::Time $proxy_connect_timeout = '90s',
Integer $proxy_headers_hash_bucket_size = 64,
Optional[Integer] $proxy_headers_hash_max_size = undef,
Optional[String] $proxy_http_version = undef,
Nginx::Time $proxy_read_timeout = '90s',
Optional[Variant[Array[String],String]] $proxy_redirect = undef,
Expand Down Expand Up @@ -397,24 +401,26 @@
### END Service Configuration ###

### START Hiera Lookups ###
Hash $geo_mappings = {},
Hash $geo_mappings_defaults = {},
Hash $string_mappings = {},
Hash $string_mappings_defaults = {},
Hash $nginx_snippets = {},
Hash $nginx_snippets_defaults = {},
Hash $nginx_locations = {},
Hash $nginx_locations_defaults = {},
Hash $nginx_mailhosts = {},
Hash $nginx_mailhosts_defaults = {},
Hash $nginx_servers = {},
Hash $nginx_servers_defaults = {},
Hash $nginx_streamhosts = {},
Hash $nginx_streamhosts_defaults = {},
Hash $nginx_upstreams = {},
Nginx::UpstreamDefaults $nginx_upstreams_defaults = {},
Boolean $purge_passenger_repo = true,
String[1] $nginx_version = pick(fact('nginx_version'), '1.16.0'),
Hash $geo_mappings = {},
Hash $geo_mappings_defaults = {},
Hash $string_mappings = {},
Hash $string_mappings_defaults = {},
Hash $nginx_snippets = {},
Hash $nginx_snippets_defaults = {},
Hash $nginx_locations = {},
Hash $nginx_locations_defaults = {},
Hash $nginx_mailhosts = {},
Hash $nginx_mailhosts_defaults = {},
Hash $nginx_servers = {},
Hash $nginx_servers_defaults = {},
Hash $nginx_streamhosts = {},
Hash $nginx_streamhosts_defaults = {},
Hash $nginx_upstreams = {},
Nginx::UpstreamDefaults $nginx_upstreams_defaults = {},
Boolean $purge_passenger_repo = true,
String[1] $nginx_version = pick(fact('nginx_version'), '1.16.0'),
Optional[Integer] $variables_hash_bucket_size = undef,
Optional[Integer] $variables_hash_max_size = undef,

### END Hiera Lookups ###
) inherits nginx::params {
Expand Down
24 changes: 24 additions & 0 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,30 @@
attr: 'reset_timedout_connection',
value: 'on',
match: %r{^\s+reset_timedout_connection\s+on;}
},
{
title: 'should set variables_hash_bucket_size',
attr: 'variables_hash_bucket_size',
value: 64,
match: ' variables_hash_bucket_size 64;'
},
{
title: 'should set variables_hash_max_size',
attr: 'variables_hash_max_size',
value: 1024,
match: ' variables_hash_max_size 1024;'
},
{
title: 'should set proxy_headers_hash_bucket_size',
attr: 'proxy_headers_hash_bucket_size',
value: 64,
match: ' proxy_headers_hash_bucket_size 64;'
},
{
title: 'should set proxy_headers_hash_max_size',
attr: 'proxy_headers_hash_max_size',
value: 512,
match: ' proxy_headers_hash_max_size 512;'
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down
10 changes: 10 additions & 0 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ http {
map_hash_max_size <%= @map_hash_max_size %>;
<% end -%>

<% if @variables_hash_bucket_size -%>
variables_hash_bucket_size <%= @variables_hash_bucket_size %>;
<% end -%>
<% if @variables_hash_max_size -%>
variables_hash_max_size <%= @variables_hash_max_size %>;
<% end -%>

keepalive_timeout <%= @keepalive_timeout %>;
keepalive_requests <%= @keepalive_requests %>;
client_body_timeout <%= @client_body_timeout %>;
Expand Down Expand Up @@ -226,6 +233,9 @@ http {
<% if @proxy_headers_hash_bucket_size -%>
proxy_headers_hash_bucket_size <%= @proxy_headers_hash_bucket_size %>;
<% end -%>
<% if @proxy_headers_hash_max_size -%>
proxy_headers_hash_max_size <%= @proxy_headers_hash_max_size %>;
<% end -%>
<% if @proxy_cache_path.is_a?(Hash) -%>
<% @proxy_cache_path.sort_by{|k,v| k}.each do |key,value| -%>
proxy_cache_path <%= key %> levels=<%= @proxy_cache_levels %> keys_zone=<%= value %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive -%>
Expand Down