Puppet Class: nginx

Inherits:
nginx::params
Defined in:
manifests/init.pp

Summary

Manage NGINX

Overview

Packaged NGINX

- RHEL: EPEL or custom package
- Debian/Ubuntu: Default Install or custom package
- SuSE: Default Install or custom package

Examples:

Use the sensible defaults

include nginx

Parameters:

  • include_modules_enabled (Boolean) (defaults to: $nginx::params::include_modules_enabled)

    When set, nginx will include module configurations files installed in the /etc/nginx/modules-enabled directory. This is also enabled if mail is being configured (to allow the module to be loaded).

  • passenger_package_name (String[1]) (defaults to: $nginx::params::passenger_package_name)

    The name of the package to install in order for the passenger module of nginx to be usable.

  • mail_package_name (Optional[String[1]]) (defaults to: $nginx::params::mail_package_name)

    The name of the package to install in order for the mail module of nginx to be usable.

  • nginx_version (String[1]) (defaults to: pick(fact('nginx_version'), '1.16.0'))

    The version of nginx installed (or being installed). Unfortunately, different versions of nginx may need configuring differently. The default is derived from the version of nginx already installed. If the fact is unavailable, it defaults to ‘1.6.0’. You may need to set this manually to get a working and idempotent configuration.

  • debug_connections (Array[Nginx::DebugConnection]) (defaults to: [])

    Configures nginx ‘debug_connection` lines in the `events` section of the nginx config. See nginx.org/en/docs/ngx_core_module.html#debug_connection

  • service_config_check (Boolean) (defaults to: false)

    whether to en- or disable the config check via nginx -t on config changes

  • service_config_check_command (String) (defaults to: 'nginx -t')

    Command to execute to validate the generated configuration.

  • reset_timedout_connection (Optional[Enum['on', 'off']]) (defaults to: undef)

    Enables or disables resetting timed out connections and connections closed with the non-standard code 444.

  • nginx_snippets (Hash) (defaults to: {})

    Specifies a hash from which to generate ‘nginx::resource::snippet` resources.

  • nginx_snippets_defaults (Hash) (defaults to: {})

    Can be used to define default values for the parameter ‘nginx_snippets`.

  • client_body_temp_path (Optional[Variant[Stdlib::Absolutepath, Tuple[Stdlib::Absolutepath, Integer, 1, 4]]]) (defaults to: undef)
  • confd_only (Boolean) (defaults to: false)
  • confd_purge (Boolean) (defaults to: false)
  • conf_dir (Stdlib::Absolutepath) (defaults to: $nginx::params::conf_dir)
  • daemon (Optional[Enum['on', 'off']]) (defaults to: undef)
  • daemon_user (String[1]) (defaults to: $nginx::params::daemon_user)
  • daemon_group (Optional[String[1]]) (defaults to: undef)
  • dynamic_modules (Array[String]) (defaults to: [])
  • global_owner (String[1]) (defaults to: 'root')
  • global_group (String[1]) (defaults to: $nginx::params::global_group)
  • global_mode (Stdlib::Filemode) (defaults to: '0644')
  • limit_req_zone (Optional[Variant[String[1], Array[String[1]]]]) (defaults to: undef)
  • log_dir (Stdlib::Absolutepath) (defaults to: $nginx::params::log_dir)
  • manage_log_dir (Boolean) (defaults to: true)
  • log_user (String[1]) (defaults to: $nginx::params::log_user)
  • log_group (String[1]) (defaults to: $nginx::params::log_group)
  • log_mode (Stdlib::Filemode) (defaults to: $nginx::params::log_mode)
  • http_access_log (Variant[String, Array[String]]) (defaults to: "${log_dir}/access.log")
  • http_format_log (Optional[String]) (defaults to: undef)
  • stream_access_log (Variant[String, Array[String]]) (defaults to: "${log_dir}/stream-access.log")
  • stream_custom_format_log (Optional[String]) (defaults to: undef)
  • nginx_error_log (Variant[String, Array[String]]) (defaults to: "${log_dir}/error.log")
  • nginx_error_log_severity (Nginx::ErrorLogSeverity) (defaults to: 'error')
  • pid (Variant[Stdlib::Absolutepath,Boolean]) (defaults to: $nginx::params::pid)
  • proxy_temp_path (Optional[Variant[Stdlib::Absolutepath, Tuple[Stdlib::Absolutepath, Integer, 1, 4]]]) (defaults to: undef)
  • root_group (String[1]) (defaults to: $nginx::params::root_group)
  • sites_available_owner (String[1]) (defaults to: 'root')
  • sites_available_group (String[1]) (defaults to: $nginx::params::sites_available_group)
  • sites_available_mode (Stdlib::Filemode) (defaults to: '0644')
  • super_user (Boolean) (defaults to: true)
  • temp_dir (Stdlib::Absolutepath) (defaults to: '/tmp')
  • server_purge (Boolean) (defaults to: false)
  • conf_template (String[1]) (defaults to: 'nginx/conf.d/nginx.conf.erb')
  • fastcgi_conf_template (String[1]) (defaults to: 'nginx/server/fastcgi.conf.erb')
  • uwsgi_params_template (String[1]) (defaults to: 'nginx/server/uwsgi_params.erb')
  • absolute_redirect (Optional[Enum['on', 'off']]) (defaults to: undef)
  • accept_mutex (Enum['on', 'off']) (defaults to: 'on')
  • accept_mutex_delay (Nginx::Time) (defaults to: '500ms')
  • client_body_buffer_size (Nginx::Size) (defaults to: '128k')
  • client_max_body_size (Nginx::Size) (defaults to: '10m')
  • client_body_timeout (Nginx::Time) (defaults to: '60s')
  • send_timeout (Nginx::Time) (defaults to: '60s')
  • lingering_timeout (Nginx::Time) (defaults to: '5s')
  • lingering_close (Optional[Enum['on','off','always']]) (defaults to: undef)
  • lingering_time (Optional[String[1]]) (defaults to: undef)
  • etag (Optional[Enum['on', 'off']]) (defaults to: undef)
  • events_use (Optional[String]) (defaults to: undef)
  • fastcgi_cache_inactive (Nginx::Time) (defaults to: '20m')
  • fastcgi_cache_key (Optional[String]) (defaults to: undef)
  • fastcgi_cache_keys_zone (String) (defaults to: 'd3:100m')
  • fastcgi_cache_levels (String) (defaults to: '1')
  • fastcgi_cache_max_size (Nginx::Size) (defaults to: '500m')
  • fastcgi_cache_path (Optional[String]) (defaults to: undef)
  • fastcgi_cache_use_stale (Optional[String]) (defaults to: undef)
  • gzip (Enum['on', 'off']) (defaults to: 'off')
  • gzip_buffers (Optional[String]) (defaults to: undef)
  • gzip_comp_level (Integer) (defaults to: 1)
  • gzip_disable (String) (defaults to: 'msie6')
  • gzip_min_length (Integer) (defaults to: 20)
  • gzip_http_version (Enum['1.0','1.1']) (defaults to: '1.1')
  • gzip_proxied (Variant[Nginx::GzipProxied, Array[Nginx::GzipProxied]]) (defaults to: 'off')
  • gzip_types (Optional[Variant[String[1],Array[String[1]]]]) (defaults to: undef)
  • gzip_vary (Enum['on', 'off']) (defaults to: 'off')
  • gzip_static (Optional[Enum['on', 'off', 'always']]) (defaults to: undef)
  • http_cfg_prepend (Optional[Variant[Hash, Array]]) (defaults to: undef)
  • http_cfg_append (Optional[Variant[Hash, Array]]) (defaults to: undef)
  • http_raw_prepend (Optional[Variant[Array[String], String]]) (defaults to: undef)
  • http_raw_append (Optional[Variant[Array[String], String]]) (defaults to: undef)
  • http_tcp_nodelay (Enum['on', 'off']) (defaults to: 'on')
  • http_tcp_nopush (Enum['on', 'off']) (defaults to: 'off')
  • keepalive_timeout (Nginx::Time) (defaults to: '65s')
  • keepalive_requests (Integer) (defaults to: 100)
  • log_format (Hash[String[1], Nginx::LogFormat]) (defaults to: {})
  • stream_log_format (Hash[String[1], Nginx::LogFormat]) (defaults to: {})
  • mail (Boolean) (defaults to: false)
  • map_hash_bucket_size (Optional[Integer]) (defaults to: undef)
  • map_hash_max_size (Optional[Integer]) (defaults to: undef)
  • mime_types_path (Variant[String, Boolean]) (defaults to: 'mime.types')
  • stream (Boolean) (defaults to: false)
  • multi_accept (String) (defaults to: 'off')
  • names_hash_bucket_size (Integer) (defaults to: 64)
  • names_hash_max_size (Integer) (defaults to: 512)
  • nginx_cfg_prepend (Variant[Boolean,Array,Hash]) (defaults to: false)
  • proxy_buffers (String) (defaults to: '32 4k')
  • proxy_buffer_size (Nginx::Size) (defaults to: '8k')
  • proxy_cache_inactive (Nginx::Time) (defaults to: '20m')
  • proxy_cache_keys_zone (String) (defaults to: 'd2:100m')
  • proxy_cache_levels (String) (defaults to: '1')
  • proxy_cache_max_size (Nginx::Size) (defaults to: '500m')
  • proxy_cache_path (Optional[Variant[Hash, String]]) (defaults to: undef)
  • proxy_cache_loader_files (Optional[Integer]) (defaults to: undef)
  • proxy_cache_loader_sleep (Optional[String]) (defaults to: undef)
  • proxy_cache_loader_threshold (Optional[String]) (defaults to: undef)
  • proxy_use_temp_path (Optional[Enum['on', 'off']]) (defaults to: undef)
  • proxy_connect_timeout (Nginx::Time) (defaults to: '90s')
  • proxy_headers_hash_bucket_size (Integer) (defaults to: 64)
  • proxy_http_version (Optional[String]) (defaults to: undef)
  • proxy_read_timeout (Nginx::Time) (defaults to: '90s')
  • proxy_redirect (Optional[String]) (defaults to: undef)
  • proxy_send_timeout (Nginx::Time) (defaults to: '90s')
  • proxy_set_header (Array) (defaults to: [ 'Host $host', 'X-Real-IP $remote_addr', 'X-Forwarded-For $proxy_add_x_forwarded_for', 'X-Forwarded-Host $host', 'X-Forwarded-Proto $scheme', 'Proxy ""', ])
  • proxy_hide_header (Array) (defaults to: [])
  • proxy_pass_header (Array) (defaults to: [])
  • proxy_ignore_header (Array) (defaults to: [])
  • proxy_max_temp_file_size (Optional[Nginx::Size]) (defaults to: undef)
  • proxy_busy_buffers_size (Optional[Nginx::Size]) (defaults to: undef)
  • sendfile (Enum['on', 'off']) (defaults to: 'on')
  • server_tokens (Enum['on', 'off']) (defaults to: 'on')
  • spdy (Enum['on', 'off']) (defaults to: 'off')
  • http2 (Enum['on', 'off']) (defaults to: 'off')
  • ssl_stapling (Enum['on', 'off']) (defaults to: 'off')
  • ssl_stapling_verify (Enum['on', 'off']) (defaults to: 'off')
  • snippets_dir (Stdlib::Absolutepath) (defaults to: $nginx::params::snippets_dir)
  • manage_snippets_dir (Boolean) (defaults to: true)
  • types_hash_bucket_size (Variant[Integer,String]) (defaults to: '512')
  • types_hash_max_size (Variant[Integer,String]) (defaults to: '1024')
  • worker_connections (Integer) (defaults to: 1024)
  • ssl_prefer_server_ciphers (Enum['on', 'off']) (defaults to: 'on')
  • worker_processes (Variant[Integer, Enum['auto']]) (defaults to: 'auto')
  • worker_rlimit_nofile (Integer) (defaults to: 1024)
  • pcre_jit (Optional[Enum['on', 'off']]) (defaults to: undef)
  • ssl_protocols (String) (defaults to: 'TLSv1 TLSv1.1 TLSv1.2')
  • ssl_ciphers (String) (defaults to: 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS')
  • ssl_dhparam (Optional[Stdlib::Unixpath]) (defaults to: undef)
  • ssl_ecdh_curve (Optional[String]) (defaults to: undef)
  • ssl_session_cache (String) (defaults to: 'shared:SSL:10m')
  • ssl_session_timeout (Nginx::Time) (defaults to: '5m')
  • ssl_session_tickets (Optional[Enum['on', 'off']]) (defaults to: undef)
  • ssl_session_ticket_key (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • ssl_buffer_size (Optional[String]) (defaults to: undef)
  • ssl_crl (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • ssl_stapling_file (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • ssl_stapling_responder (Optional[String]) (defaults to: undef)
  • ssl_trusted_certificate (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • ssl_verify_depth (Optional[Integer]) (defaults to: undef)
  • ssl_password_file (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • package_ensure (String) (defaults to: installed)
  • package_name (String) (defaults to: $nginx::params::package_name)
  • package_source (Nginx::Package_source) (defaults to: 'nginx')
  • package_flavor (Optional[String]) (defaults to: undef)
  • manage_repo (Boolean) (defaults to: $nginx::params::manage_repo)
  • mime_types (Hash[String[1], String[1]]) (defaults to: $nginx::params::mime_types)
  • mime_types_preserve_defaults (Boolean) (defaults to: false)
  • repo_release (Optional[String]) (defaults to: undef)
  • passenger_package_ensure (String) (defaults to: installed)
  • repo_source (Optional[Stdlib::HTTPUrl]) (defaults to: undef)
  • service_ensure (Stdlib::Ensure::Service) (defaults to: 'running')
  • service_enable (Boolean) (defaults to: true)
  • service_flags (Optional[String]) (defaults to: undef)
  • service_restart (Optional[String]) (defaults to: undef)
  • service_name (String) (defaults to: 'nginx')
  • service_manage (Boolean) (defaults to: true)
  • geo_mappings (Hash) (defaults to: {})
  • geo_mappings_defaults (Hash) (defaults to: {})
  • string_mappings (Hash) (defaults to: {})
  • string_mappings_defaults (Hash) (defaults to: {})
  • nginx_locations (Hash) (defaults to: {})
  • nginx_locations_defaults (Hash) (defaults to: {})
  • nginx_mailhosts (Hash) (defaults to: {})
  • nginx_mailhosts_defaults (Hash) (defaults to: {})
  • nginx_servers (Hash) (defaults to: {})
  • nginx_servers_defaults (Hash) (defaults to: {})
  • nginx_streamhosts (Hash) (defaults to: {})
  • nginx_streamhosts_defaults (Hash) (defaults to: {})
  • nginx_upstreams (Hash) (defaults to: {})
  • nginx_upstreams_defaults (Nginx::UpstreamDefaults) (defaults to: {})
  • purge_passenger_repo (Boolean) (defaults to: true)


219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'manifests/init.pp', line 219

class nginx (
  ### START Nginx Configuration ###
  Optional[Variant[Stdlib::Absolutepath, Tuple[Stdlib::Absolutepath, Integer, 1, 4]]] $client_body_temp_path      = undef,
  Boolean $confd_only                                        = false,
  Boolean $confd_purge                                       = false,
  Stdlib::Absolutepath $conf_dir                             = $nginx::params::conf_dir,
  Optional[Enum['on', 'off']] $daemon                        = undef,
  String[1] $daemon_user                                     = $nginx::params::daemon_user,
  Optional[String[1]] $daemon_group                          = undef,
  Array[String] $dynamic_modules                             = [],
  String[1] $global_owner                                    = 'root',
  String[1] $global_group                                    = $nginx::params::global_group,
  Stdlib::Filemode $global_mode                              = '0644',
  Optional[Variant[String[1], Array[String[1]]]] $limit_req_zone = undef,
  Stdlib::Absolutepath $log_dir                              = $nginx::params::log_dir,
  Boolean $manage_log_dir                                    = true,
  String[1] $log_user                                        = $nginx::params::log_user,
  String[1] $log_group                                       = $nginx::params::log_group,
  Stdlib::Filemode $log_mode                                 = $nginx::params::log_mode,
  Variant[String, Array[String]] $http_access_log            = "${log_dir}/access.log",
  Optional[String] $http_format_log                          = undef,
  Variant[String, Array[String]] $stream_access_log          = "${log_dir}/stream-access.log",
  Optional[String] $stream_custom_format_log                 = undef,
  Variant[String, Array[String]] $nginx_error_log            = "${log_dir}/error.log",
  Nginx::ErrorLogSeverity $nginx_error_log_severity          = 'error',
  Variant[Stdlib::Absolutepath,Boolean] $pid                 = $nginx::params::pid,
  Optional[Variant[Stdlib::Absolutepath, Tuple[Stdlib::Absolutepath, Integer, 1, 4]]] $proxy_temp_path = undef,
  String[1] $root_group                                      = $nginx::params::root_group,
  String[1] $sites_available_owner                           = 'root',
  String[1] $sites_available_group                           = $nginx::params::sites_available_group,
  Stdlib::Filemode $sites_available_mode                     = '0644',
  Boolean $super_user                                        = true,
  Stdlib::Absolutepath $temp_dir                             = '/tmp',
  Boolean $server_purge                                      = false,
  Boolean $include_modules_enabled                           = $nginx::params::include_modules_enabled,

  # Primary Templates
  String[1] $conf_template                                   = 'nginx/conf.d/nginx.conf.erb',
  String[1] $fastcgi_conf_template                           = 'nginx/server/fastcgi.conf.erb',
  String[1] $uwsgi_params_template                           = 'nginx/server/uwsgi_params.erb',

  ### START Nginx Configuration ###
  Optional[Enum['on', 'off']] $absolute_redirect             = undef,
  Enum['on', 'off'] $accept_mutex                            = 'on',
  Nginx::Time $accept_mutex_delay                            = '500ms',
  Nginx::Size $client_body_buffer_size                       = '128k',
  Nginx::Size $client_max_body_size                          = '10m',
  Nginx::Time $client_body_timeout                           = '60s',
  Nginx::Time $send_timeout                                  = '60s',
  Nginx::Time $lingering_timeout                             = '5s',
  Optional[Enum['on','off','always']] $lingering_close       = undef,
  Optional[String[1]] $lingering_time                        = undef,
  Optional[Enum['on', 'off']] $etag                          = undef,
  Optional[String] $events_use                               = undef,
  Array[Nginx::DebugConnection] $debug_connections           = [],
  Nginx::Time $fastcgi_cache_inactive                        = '20m',
  Optional[String] $fastcgi_cache_key                        = undef,
  String $fastcgi_cache_keys_zone                            = 'd3:100m',
  String $fastcgi_cache_levels                               = '1',
  Nginx::Size $fastcgi_cache_max_size                        = '500m',
  Optional[String] $fastcgi_cache_path                       = undef,
  Optional[String] $fastcgi_cache_use_stale                  = undef,
  Enum['on', 'off'] $gzip                                    = 'off',
  Optional[String] $gzip_buffers                             = undef,
  Integer $gzip_comp_level                                   = 1,
  String $gzip_disable                                       = 'msie6',
  Integer $gzip_min_length                                   = 20,
  Enum['1.0','1.1'] $gzip_http_version                       = '1.1',
  Variant[Nginx::GzipProxied, Array[Nginx::GzipProxied]] $gzip_proxied = 'off',
  Optional[Variant[String[1],Array[String[1]]]] $gzip_types  = undef,
  Enum['on', 'off'] $gzip_vary                               = 'off',
  Optional[Enum['on', 'off', 'always']] $gzip_static         = undef,
  Optional[Variant[Hash, Array]] $http_cfg_prepend           = undef,
  Optional[Variant[Hash, Array]] $http_cfg_append            = undef,
  Optional[Variant[Array[String], String]] $http_raw_prepend = undef,
  Optional[Variant[Array[String], String]] $http_raw_append  = undef,
  Enum['on', 'off'] $http_tcp_nodelay                        = 'on',
  Enum['on', 'off'] $http_tcp_nopush                         = 'off',
  Nginx::Time $keepalive_timeout                             = '65s',
  Integer $keepalive_requests                                = 100,
  Hash[String[1], Nginx::LogFormat] $log_format              = {},
  Hash[String[1], Nginx::LogFormat] $stream_log_format       = {},
  Boolean $mail                                              = false,
  Optional[Integer] $map_hash_bucket_size                    = undef,
  Optional[Integer] $map_hash_max_size                       = undef,
  Variant[String, Boolean] $mime_types_path                  = 'mime.types',
  Boolean $stream                                            = false,
  String $multi_accept                                       = 'off',
  Integer $names_hash_bucket_size                            = 64,
  Integer $names_hash_max_size                               = 512,
  Variant[Boolean,Array,Hash] $nginx_cfg_prepend             = false,
  String $proxy_buffers                                      = '32 4k',
  Nginx::Size $proxy_buffer_size                             = '8k',
  Nginx::Time $proxy_cache_inactive                          = '20m',
  String $proxy_cache_keys_zone                              = 'd2:100m',
  String $proxy_cache_levels                                 = '1',
  Nginx::Size $proxy_cache_max_size                          = '500m',
  Optional[Variant[Hash, String]] $proxy_cache_path          = undef,
  Optional[Integer] $proxy_cache_loader_files                = undef,
  Optional[String] $proxy_cache_loader_sleep                 = undef,
  Optional[String] $proxy_cache_loader_threshold             = undef,
  Optional[Enum['on', 'off']] $proxy_use_temp_path           = undef,
  Nginx::Time $proxy_connect_timeout                         = '90s',
  Integer $proxy_headers_hash_bucket_size                    = 64,
  Optional[String] $proxy_http_version                       = undef,
  Nginx::Time $proxy_read_timeout                            = '90s',
  Optional[String] $proxy_redirect                           = undef,
  Nginx::Time $proxy_send_timeout                            = '90s',
  Array $proxy_set_header                                    = [
    'Host $host',
    'X-Real-IP $remote_addr',
    'X-Forwarded-For $proxy_add_x_forwarded_for',
    'X-Forwarded-Host $host',
    'X-Forwarded-Proto $scheme',
    'Proxy ""',
  ],
  Array $proxy_hide_header                                   = [],
  Array $proxy_pass_header                                   = [],
  Array $proxy_ignore_header                                 = [],
  Optional[Nginx::Size] $proxy_max_temp_file_size            = undef,
  Optional[Nginx::Size] $proxy_busy_buffers_size             = undef,
  Enum['on', 'off'] $sendfile                                = 'on',
  Enum['on', 'off'] $server_tokens                           = 'on',
  Enum['on', 'off'] $spdy                                    = 'off',
  Enum['on', 'off'] $http2                                   = 'off',
  Enum['on', 'off'] $ssl_stapling                            = 'off',
  Enum['on', 'off'] $ssl_stapling_verify                     = 'off',
  Stdlib::Absolutepath $snippets_dir                         = $nginx::params::snippets_dir,
  Boolean $manage_snippets_dir                               = true,
  Variant[Integer,String] $types_hash_bucket_size            = '512',
  Variant[Integer,String] $types_hash_max_size               = '1024',
  Integer $worker_connections                                = 1024,
  Enum['on', 'off'] $ssl_prefer_server_ciphers               = 'on',
  Variant[Integer, Enum['auto']] $worker_processes           = 'auto',
  Integer $worker_rlimit_nofile                              = 1024,
  Optional[Enum['on', 'off']] $pcre_jit                      = undef,
  String $ssl_protocols                                      = 'TLSv1 TLSv1.1 TLSv1.2',
  String $ssl_ciphers                                        = 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS', # lint:ignore:140chars
  Optional[Stdlib::Unixpath] $ssl_dhparam                    = undef,
  Optional[String] $ssl_ecdh_curve                           = undef,
  String $ssl_session_cache                                  = 'shared:SSL:10m',
  Nginx::Time $ssl_session_timeout                           = '5m',
  Optional[Enum['on', 'off']] $ssl_session_tickets           = undef,
  Optional[Stdlib::Absolutepath] $ssl_session_ticket_key     = undef,
  Optional[String] $ssl_buffer_size                          = undef,
  Optional[Stdlib::Absolutepath] $ssl_crl                    = undef,
  Optional[Stdlib::Absolutepath] $ssl_stapling_file          = undef,
  Optional[String] $ssl_stapling_responder                   = undef,
  Optional[Stdlib::Absolutepath] $ssl_trusted_certificate    = undef,
  Optional[Integer] $ssl_verify_depth                        = undef,
  Optional[Stdlib::Absolutepath] $ssl_password_file          = undef,
  Optional[Enum['on', 'off']] $reset_timedout_connection     = undef,

  ### START Package Configuration ###
  String $package_ensure                                     = installed,
  String $package_name                                       = $nginx::params::package_name,
  Nginx::Package_source $package_source                      = 'nginx',
  Optional[String] $package_flavor                           = undef,
  Boolean $manage_repo                                       = $nginx::params::manage_repo,
  Hash[String[1], String[1]] $mime_types                     = $nginx::params::mime_types,
  Boolean $mime_types_preserve_defaults                      = false,
  Optional[String] $repo_release                             = undef,
  String $passenger_package_ensure                           = installed,
  String[1] $passenger_package_name                          = $nginx::params::passenger_package_name,
  # This is optional, to allow it to be set to undef for systems that install it with nginx always
  Optional[String[1]] $mail_package_name                     = $nginx::params::mail_package_name,
  Optional[Stdlib::HTTPUrl] $repo_source                     = undef,
  ### END Package Configuration ###

  ### START Service Configuation ###
  Stdlib::Ensure::Service $service_ensure                    = 'running',
  Boolean $service_enable                                    = true,
  Optional[String] $service_flags                            = undef,
  Optional[String] $service_restart                          = undef,
  String $service_name                                       = 'nginx',
  Boolean $service_manage                                    = true,
  Boolean $service_config_check                              = false,
  String $service_config_check_command                       = 'nginx -t',
  ### 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'),

  ### END Hiera Lookups ###
) inherits nginx::params {
  contain 'nginx::package'
  contain 'nginx::config'
  contain 'nginx::service'

  create_resources( 'nginx::resource::geo', $geo_mappings, $geo_mappings_defaults )
  create_resources( 'nginx::resource::snippet', $nginx_snippets, $nginx_snippets_defaults )
  create_resources( 'nginx::resource::location', $nginx_locations, $nginx_locations_defaults )
  create_resources( 'nginx::resource::mailhost', $nginx_mailhosts, $nginx_mailhosts_defaults )
  create_resources( 'nginx::resource::map', $string_mappings, $string_mappings_defaults )
  create_resources( 'nginx::resource::server', $nginx_servers, $nginx_servers_defaults )
  create_resources( 'nginx::resource::streamhost', $nginx_streamhosts, $nginx_streamhosts_defaults )
  create_resources( 'nginx::resource::upstream', $nginx_upstreams, $nginx_upstreams_defaults )

  # Allow the end user to establish relationships to the "main" class
  # and preserve the relationship to the implementation classes through
  # a transitive relationship to the composite class.
  Class['nginx::package'] -> Class['nginx::config'] ~> Class['nginx::service']
  Class['nginx::package'] ~> Class['nginx::service']
}