Skip to content

Latest commit

 

History

History
4693 lines (2403 loc) · 79.6 KB

REFERENCE.md

File metadata and controls

4693 lines (2403 loc) · 79.6 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • nginx::config: Manage NGINX bootstrap and configuration
  • nginx::package: Manage NGINX package installation
  • nginx::package::debian: Manage NGINX package installation on debian based systems
  • nginx::package::redhat: Manage NGINX package installation on RedHat based systems
  • nginx::params: default settings and according to operating system
  • nginx::service: Manage NGINX service management

Defined types

Data types

Classes

nginx

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

The following parameters are available in the nginx class.

include_modules_enabled

Data type: Boolean

When set, nginx will include module configurations files installed in the /etc/nginx/modules-enabled directory.

Default value: $nginx::params::include_modules_enabled

passenger_package_name

Data type: String[1]

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

Default value: $nginx::params::passenger_package_name

nginx_version

Data type: String[1]

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.

Default value: pick(fact('nginx_version'), '1.6.0')

debug_connections

Data type: Array[Nginx::DebugConnection]

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

Default value: []

service_config_check

Data type: Boolean

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

Default value: false

service_config_check_command

Data type: String

Command to execute to validate the generated configuration.

Default value: 'nginx -t'

reset_timedout_connection

Data type: Optional[Enum['on', 'off']]

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

Default value: undef

client_body_temp_path

Data type: Variant[Stdlib::Absolutepath, Boolean]

Default value: $nginx::params::client_body_temp_path

confd_only

Data type: Boolean

Default value: false

confd_purge

Data type: Boolean

Default value: false

conf_dir

Data type: Any

Default value: $nginx::params::conf_dir

daemon

Data type: Optional[Enum['on', 'off']]

Default value: undef

daemon_user

Data type: Any

Default value: $nginx::params::daemon_user

daemon_group

Data type: Any

Default value: undef

dynamic_modules

Data type: Array[String]

Default value: []

global_owner

Data type: Any

Default value: $nginx::params::global_owner

global_group

Data type: Any

Default value: $nginx::params::global_group

global_mode

Data type: Any

Default value: $nginx::params::global_mode

limit_req_zone

Data type: Optional[Variant[String[1], Array[String[1]]]]

Default value: undef

log_dir

Data type: Stdlib::Absolutepath

Default value: $nginx::params::log_dir

log_user

Data type: String[1]

Default value: $nginx::params::log_user

log_group

Data type: String[1]

Default value: $nginx::params::log_group

log_mode

Data type: Stdlib::Filemode

Default value: $nginx::params::log_mode

http_access_log

Data type: Variant[String, Array[String]]

Default value: "${log_dir}/${nginx::params::http_access_log_file}"

http_format_log

Data type: Optional[String]

Default value: undef

nginx_error_log

Data type: Variant[String, Array[String]]

Default value: "${log_dir}/${nginx::params::nginx_error_log_file}"

nginx_error_log_severity

Data type: Nginx::ErrorLogSeverity

Default value: 'error'

pid

Data type: Any

Default value: $nginx::params::pid

proxy_temp_path

Data type: Variant[Stdlib::Absolutepath, Boolean]

Default value: $nginx::params::proxy_temp_path

root_group

Data type: Any

Default value: $nginx::params::root_group

run_dir

Data type: Any

Default value: $nginx::params::run_dir

sites_available_owner

Data type: Any

Default value: $nginx::params::sites_available_owner

sites_available_group

Data type: Any

Default value: $nginx::params::sites_available_group

sites_available_mode

Data type: Any

Default value: $nginx::params::sites_available_mode

super_user

Data type: Boolean

Default value: $nginx::params::super_user

temp_dir

Data type: Any

Default value: $nginx::params::temp_dir

server_purge

Data type: Boolean

Default value: false

conf_template

Data type: String[1]

Default value: 'nginx/conf.d/nginx.conf.erb'

fastcgi_conf_template

Data type: String[1]

Default value: 'nginx/server/fastcgi.conf.erb'

uwsgi_params_template

Data type: String[1]

Default value: 'nginx/server/uwsgi_params.erb'

absolute_redirect

Data type: Optional[Enum['on', 'off']]

Default value: undef

accept_mutex

Data type: Enum['on', 'off']

Default value: 'on'

accept_mutex_delay

Data type: Any

Default value: '500ms'

client_body_buffer_size

Data type: Any

Default value: '128k'

client_max_body_size

Data type: String

Default value: '10m'

client_body_timeout

Data type: Any

Default value: '60s'

send_timeout

Data type: Any

Default value: '60s'

lingering_timeout

Data type: Any

Default value: '5s'

lingering_close

Data type: Optional[Enum['on','off','always']]

Default value: undef

lingering_time

Data type: Optional[String[1]]

Default value: undef

etag

Data type: Optional[Enum['on', 'off']]

Default value: undef

events_use

Data type: Optional[String]

Default value: undef

fastcgi_cache_inactive

Data type: String

Default value: '20m'

fastcgi_cache_key

Data type: Optional[String]

Default value: undef

fastcgi_cache_keys_zone

Data type: String

Default value: 'd3:100m'

fastcgi_cache_levels

Data type: String

Default value: '1'

fastcgi_cache_max_size

Data type: String

Default value: '500m'

fastcgi_cache_path

Data type: Optional[String]

Default value: undef

fastcgi_cache_use_stale

Data type: Optional[String]

Default value: undef

gzip

Data type: Enum['on', 'off']

Default value: 'off'

gzip_buffers

Data type: Any

Default value: undef

gzip_comp_level

Data type: Any

Default value: 1

gzip_disable

Data type: Any

Default value: 'msie6'

gzip_min_length

Data type: Any

Default value: 20

gzip_http_version

Data type: Any

Default value: 1.1

gzip_proxied

Data type: Any

Default value: 'off'

gzip_types

Data type: Any

Default value: undef

gzip_vary

Data type: Enum['on', 'off']

Default value: 'off'

gzip_static

Data type: Optional[Enum['on', 'off', 'always']]

Default value: undef

http_cfg_prepend

Data type: Optional[Variant[Hash, Array]]

Default value: undef

http_cfg_append

Data type: Optional[Variant[Hash, Array]]

Default value: undef

http_raw_prepend

Data type: Optional[Variant[Array[String], String]]

Default value: undef

http_raw_append

Data type: Optional[Variant[Array[String], String]]

Default value: undef

http_tcp_nodelay

Data type: Enum['on', 'off']

Default value: 'on'

http_tcp_nopush

Data type: Enum['on', 'off']

Default value: 'off'

keepalive_timeout

Data type: Any

Default value: '65s'

keepalive_requests

Data type: Any

Default value: '100'

log_format

Data type: Any

Default value: {}

mail

Data type: Boolean

Default value: false

mime_types_path

Data type: Variant[String, Boolean]

Default value: 'mime.types'

stream

Data type: Boolean

Default value: false

multi_accept

Data type: String

Default value: 'off'

names_hash_bucket_size

Data type: Integer

Default value: 64

names_hash_max_size

Data type: Integer

Default value: 512

nginx_cfg_prepend

Data type: Any

Default value: false

proxy_buffers

Data type: String

Default value: '32 4k'

proxy_buffer_size

Data type: String

Default value: '8k'

proxy_cache_inactive

Data type: String

Default value: '20m'

proxy_cache_keys_zone

Data type: String

Default value: 'd2:100m'

proxy_cache_levels

Data type: String

Default value: '1'

proxy_cache_max_size

Data type: String

Default value: '500m'

proxy_cache_path

Data type: Optional[Variant[Hash, String]]

Default value: undef

proxy_cache_loader_files

Data type: Optional[Integer]

Default value: undef

proxy_cache_loader_sleep

Data type: Optional[String]

Default value: undef

proxy_cache_loader_threshold

Data type: Optional[String]

Default value: undef

proxy_use_temp_path

Data type: Optional[Enum['on', 'off']]

Default value: undef

proxy_connect_timeout

Data type: Any

Default value: '90s'

proxy_headers_hash_bucket_size

Data type: Integer

Default value: 64

proxy_http_version

Data type: Optional[String]

Default value: undef

proxy_read_timeout

Data type: Any

Default value: '90s'

proxy_redirect

Data type: Any

Default value: undef

proxy_send_timeout

Data type: Any

Default value: '90s'

proxy_set_header

Data type: Array

Default value: [ 'Host $host', 'X-Real-IP $remote_addr', 'X-Forwarded-For $proxy_add_x_forwarded_for', 'Proxy ""', ]

proxy_hide_header

Data type: Array

Default value: []

proxy_pass_header

Data type: Array

Default value: []

proxy_ignore_header

Data type: Array

Default value: []

proxy_max_temp_file_size

Data type: Optional[Nginx::Size]

Default value: undef

proxy_busy_buffers_size

Data type: Optional[Nginx::Size]

Default value: undef

sendfile

Data type: Enum['on', 'off']

Default value: 'on'

server_tokens

Data type: Enum['on', 'off']

Default value: 'on'

spdy

Data type: Enum['on', 'off']

Default value: 'off'

http2

Data type: Enum['on', 'off']

Default value: 'off'

ssl_stapling

Data type: Enum['on', 'off']

Default value: 'off'

ssl_stapling_verify

Data type: Enum['on', 'off']

Default value: 'off'

snippets_dir

Data type: Stdlib::Absolutepath

Default value: $nginx::params::snippets_dir

manage_snippets_dir

Data type: Boolean

Default value: true

types_hash_bucket_size

Data type: Any

Default value: '512'

types_hash_max_size

Data type: Any

Default value: '1024'

worker_connections

Data type: Integer

Default value: 1024

ssl_prefer_server_ciphers

Data type: Enum['on', 'off']

Default value: 'on'

worker_processes

Data type: Variant[Integer, Enum['auto']]

Default value: 'auto'

worker_rlimit_nofile

Data type: Integer

Default value: 1024

pcre_jit

Data type: Optional[Enum['on', 'off']]

Default value: undef

ssl_protocols

Data type: String

Default value: 'TLSv1 TLSv1.1 TLSv1.2'

ssl_ciphers

Data type: String

Default value: '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

Data type: Optional[Stdlib::Unixpath]

Default value: undef

ssl_ecdh_curve

Data type: Optional[String]

Default value: undef

ssl_session_cache

Data type: String

Default value: 'shared:SSL:10m'

ssl_session_timeout

Data type: String

Default value: '5m'

ssl_session_tickets

Data type: Optional[Enum['on', 'off']]

Default value: undef

ssl_session_ticket_key

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_buffer_size

Data type: Optional[String]

Default value: undef

ssl_crl

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_stapling_file

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_stapling_responder

Data type: Optional[String]

Default value: undef

ssl_trusted_certificate

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

ssl_verify_depth

Data type: Optional[Integer]

Default value: undef

ssl_password_file

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

package_ensure

Data type: Any

Default value: present

package_name

Data type: Any

Default value: $nginx::params::package_name

package_source

Data type: Any

Default value: 'nginx'

package_flavor

Data type: Any

Default value: undef

manage_repo

Data type: Boolean

Default value: $nginx::params::manage_repo

mime_types

Data type: Hash[String[1], String[1]]

Default value: $nginx::params::mime_types

mime_types_preserve_defaults

Data type: Boolean

Default value: false

repo_release

Data type: Optional[String]

Default value: undef

passenger_package_ensure

Data type: Any

Default value: 'present'

repo_source

Data type: Optional[Stdlib::HTTPUrl]

Default value: undef

service_ensure

Data type: Stdlib::Ensure::Service

Default value: 'running'

service_enable

Data type: Any

Default value: true

service_flags

Data type: Any

Default value: undef

service_restart

Data type: Any

Default value: undef

service_name

Data type: Any

Default value: 'nginx'

service_manage

Data type: Any

Default value: true

geo_mappings

Data type: Hash

Default value: {}

geo_mappings_defaults

Data type: Hash

Default value: {}

string_mappings

Data type: Hash

Default value: {}

string_mappings_defaults

Data type: Hash

Default value: {}

nginx_locations

Data type: Hash

Default value: {}

nginx_locations_defaults

Data type: Hash

Default value: {}

nginx_mailhosts

Data type: Hash

Default value: {}

nginx_mailhosts_defaults

Data type: Hash

Default value: {}

nginx_servers

Data type: Hash

Default value: {}

nginx_servers_defaults

Data type: Hash

Default value: {}

nginx_streamhosts

Data type: Hash

Default value: {}

nginx_streamhosts_defaults

Data type: Hash

Default value: {}

nginx_upstreams

Data type: Hash

Default value: {}

nginx_upstreams_defaults

Data type: Nginx::UpstreamDefaults

Default value: {}

purge_passenger_repo

Data type: Boolean

Default value: true

Defined types

nginx::resource::geo

Create a new geo mapping entry for NGINX

Examples

Puppet usage
nginx::resource::geo { 'client_network':
  ensure          => present,
  ranges          => false,
  default         => extra,
  proxy_recursive => false,
  proxies         => [ '192.168.99.99' ],
  networks        => {
    '10.0.0.0/8'     => 'intra',
    '172.16.0.0/12'  => 'intra',
    '192.168.0.0/16' => 'intra',
  }
}
Hiera usage
nginx::geo_mappings:
  client_network:
    ensure: present
    ranges: false
    default: 'extra'
    proxy_recursive: false
    proxies:
       - 192.168.99.99
    networks:
      '10.0.0.0/8': 'intra'
      '172.16.0.0/12': 'intra'
      '192.168.0.0/16': 'intra'

Parameters

The following parameters are available in the nginx::resource::geo defined type.

networks

Data type: Hash

Hash of geo lookup keys and resultant values

default

Data type: Optional[String]

Sets the resulting value if the source value fails to match any of the variants.

Default value: undef

ensure

Data type: Enum['present', 'absent']

Enables or disables the specified location

Default value: 'present'

ranges

Data type: Boolean

Indicates that lookup keys (network addresses) are specified as ranges.

Default value: false

address

Data type: Optional[String]

Nginx defaults to using $remote_addr for testing. This allows you to override that with another variable name (automatically prefixed with $)

Default value: undef

delete

Data type: Optional[String]

deletes the specified network (see: geo module docs)

Default value: undef

proxy_recursive

Data type: Optional[Boolean]

Changes the behavior of address acquisition when specifying trusted proxies via 'proxies' directive

Default value: undef

proxies

Data type: Optional[Array]

Hash of network->value mappings.

Default value: undef

nginx::resource::location

Create a new location entry within a virtual host

Examples

Simple example
nginx::resource::location { 'test2.local-bob':
  ensure   => present,
  www_root => '/var/www/bob',
  location => '/bob',
  server   => 'test2.local',
}
Use one location in multiple servers
nginx::resource::location { 'test2.local-bob':
  ensure   => present,
  www_root => '/var/www/bob',
  location => '/bob',
  server   => ['test1.local','test2.local'],
}
Custom config example to limit location on localhost, create a hash with any extra custom config you want.
$my_config = {
  'access_log' => 'off',
  'allow'      => '127.0.0.1',
  'deny'       => 'all'
}
nginx::resource::location { 'test2.local-bob':
  ensure              => present,
  www_root            => '/var/www/bob',
  location            => '/bob',
  server              => 'test2.local',
  location_cfg_append => $my_config,
}
Add Custom fastcgi_params
nginx::resource::location { 'test2.local-bob':
  ensure        => present,
  www_root      => '/var/www/bob',
  location      => '/bob',
  server        => 'test2.local',
  fastcgi_param => {
     'APP_ENV'  => 'local',
  }
}
Add Custom uwsgi_params
nginx::resource::location { 'test2.local-bob':
  ensure       => present,
  www_root     => '/var/www/bob',
  location     => '/bob',
  server       => 'test2.local',
  uwsgi_param  => {
     'APP_ENV' => 'local',
  }
}

Parameters

The following parameters are available in the nginx::resource::location defined type.

ensure

Data type: Enum['present', 'absent']

Enables or disables the specified location (present|absent)

Default value: 'present'

internal

Data type: Boolean

Indicates whether or not this location can be used for internal requests only. Default: false

Default value: false

server

Data type: Variant[String[1],Array[String[1],1]]

Defines a server or list of servers that include this location

Default value: undef

location

Data type: String

Specifies the URI associated with this location entry

Default value: $name

location_satisfy

Data type: Optional[Enum['any', 'all']]

Allows access if all (all) or at least one (any) of the auth modules allow access.

Default value: undef

location_allow

Data type: Optional[Array]

Locations to allow connections from.

Default value: undef

location_deny

Data type: Optional[Array]

Locations to deny connections from.

Default value: undef

www_root

Data type: Optional[String]

Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy

Default value: undef

autoindex

Data type: Optional[String]

Set it on 'on' to activate autoindex directory listing.

Default value: undef

autoindex_exact_size

Data type: Optional[Enum['on', 'off']]

Set it on 'on' or 'off' to activate/deactivate autoindex displaying exact filesize, or rounded to kilobytes, megabytes and gigabytes.

Default value: undef

autoindex_format

Data type: Optional[Enum['html', 'xml', 'json', 'jsonp']]

Sets the format of a directory listing.

Default value: undef

autoindex_localtime

Data type: Optional[Enum['on', 'off']]

Specifies whether times in the directory listing should be output in the local time zone or UTC.

Default value: undef

index_files

Data type: Array

Default index files for NGINX to read when traversing a directory

Default value: [ 'index.html', 'index.htm', 'index.php', ]

proxy

Data type: Optional[String]

Proxy server(s) for a location to connect to. Accepts a single value, can be used in conjunction with nginx::resource::upstream

Default value: undef

proxy_redirect

Data type: Optional[String]

sets the text, which must be changed in response-header "Location" and "Refresh" in the response of the proxied server.

Default value: $nginx::proxy_redirect

proxy_read_timeout

Data type: String

Override the default the proxy read timeout value of 90 seconds

Default value: $nginx::proxy_read_timeout

proxy_connect_timeout

Data type: String

Override the default the proxy connect timeout value of 90 seconds

Default value: $nginx::proxy_connect_timeout

proxy_send_timeout

Data type: String

Override the default the proxy send timeout value of 90 seconds

Default value: $nginx::proxy_send_timeout

proxy_set_header

Data type: Array

Array of server headers to set

Default value: $nginx::proxy_set_header

proxy_hide_header

Data type: Array

Array of server headers to hide

Default value: $nginx::proxy_hide_header

proxy_pass_header

Data type: Array

Array of server headers to pass

Default value: $nginx::proxy_pass_header

proxy_ignore_header

Data type: Array

Array of server headers to ignore

Default value: $nginx::proxy_ignore_header

proxy_next_upstream

Data type: Optional[String]

Specify cases a request should be passed to the next server in the upstream.

Default value: undef

fastcgi

Data type: Optional[String]

location of fastcgi (host:port)

Default value: undef

fastcgi_param

Data type: Optional[Hash]

Set additional custom fastcgi_params

Default value: undef

fastcgi_params

Data type: String

optional alternative fastcgi_params file to use

Default value: "${nginx::conf_dir}/fastcgi.conf"

fastcgi_script

Data type: Optional[String]

optional SCRIPT_FILE parameter

Default value: undef

fastcgi_split_path

Data type: Optional[String]

Allows settings of fastcgi_split_path_info so that you can split the script_name and path_info via regex

Default value: undef

uwsgi

Data type: Optional[String]

location of uwsgi (host:port)

Default value: undef

uwsgi_param

Data type: Optional[Hash]

Set additional custom uwsgi_params

Default value: undef

uwsgi_params

Data type: String

optional alternative uwsgi_params file to use

Default value: "${nginx::config::conf_dir}/uwsgi_params"

uwsgi_read_timeout

Data type: Optional[String]

optional value for uwsgi_read_timeout

Default value: undef

ssl

Data type: Boolean

Indicates whether to setup SSL bindings for this location.

Default value: false

ssl_only

Data type: Boolean

Required if the SSL and normal server have the same port.

Default value: false

location_alias

Data type: Optional[String]

Path to be used as basis for serving requests for this location

Default value: undef

stub_status

Data type: Optional[Boolean]

If true it will point configure module stub_status to provide nginx stats on location

Default value: undef

raw_prepend

Data type: Optional[Variant[String, Array]]

A single string, or an array of strings to prepend to the location directive (after custom_cfg directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

raw_append

Data type: Optional[Variant[String, Array]]

A single string, or an array of strings to append to the location directive (after custom_cfg directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

limit_zone

Data type: Optional[String[1]]

Apply a limit_req_zone to the location. Expects a string indicating a previously defined limit_req_zone in the main nginx configuration

Default value: undef

location_custom_cfg

Data type: Optional[Hash]

Expects a hash with custom directives, cannot be used with other location types (proxy, fastcgi, root, or stub_status)

Default value: undef

location_cfg_prepend

Data type: Optional[Hash]

Expects a hash with extra directives to put before anything else inside location (used with all other types except custom_cfg)

Default value: undef

location_custom_cfg_prepend

Data type: Optional[Hash]

Expects a array with extra directives to put before anything else inside location (used with all other types except custom_cfg). Used for logical structures such as if.

Default value: undef

location_custom_cfg_append

Data type: Optional[Hash]

Expects a array with extra directives to put after anything else inside location (used with all other types except custom_cfg). Used for logical structures such as if.

Default value: undef

location_cfg_append

Data type: Optional[Hash]

Expects a hash with extra directives to put after everything else inside location (used with all other types except custom_cfg)

Default value: undef

include

Data type: Optional[Array]

An array of files to include for this location

Default value: undef

try_files

Data type: Optional[Array]

An array of file locations to try

Default value: undef

proxy_cache

Data type: Optional[String]

This directive sets name of zone for caching. The same zone can be used in multiple places.

Default value: undef

proxy_cache_key

Data type: Optional[String]

Override the default proxy_cache_key of $scheme$proxy_host$request_uri

Default value: undef

proxy_cache_use_stale

Data type: Optional[String]

Override the default proxy_cache_use_stale value of off.

Default value: undef

proxy_cache_valid

Data type: Optional[Variant[Array, String]]

This directive sets the time for caching different replies.

Default value: undef

proxy_cache_lock

Data type: Optional[Enum['on', 'off']]

This directive sets the locking mechanism for pouplating cache.

Default value: undef

proxy_cache_bypass

Data type: Optional[Variant[Array, String]]

Defines conditions which the response will not be cached

Default value: undef

proxy_method

Data type: Optional[String]

If defined, overrides the HTTP method of the request to be passed to the backend.

Default value: undef

proxy_http_version

Data type: Optional[String]

Sets the proxy http version

Default value: undef

proxy_set_body

Data type: Optional[String]

If defined, sets the body passed to the backend.

Default value: undef

proxy_buffering

Data type: Optional[Enum['on', 'off']]

If defined, sets the proxy_buffering to the passed value.

Default value: undef

proxy_request_buffering

Data type: Optional[Enum['on', 'off']]

If defined, sets the proxy_request_buffering to the passed value.

Default value: undef

proxy_max_temp_file_size

Data type: Optional[Nginx::Size]

Sets the maximum size of the temporary buffer file.

Default value: undef

proxy_busy_buffers_size

Data type: Optional[Nginx::Size]

Sets the total size of buffers that can be busy sending a response to the client while the response is not yet fully read.

Default value: undef

absolute_redirect

Data type: Optional[Enum['on', 'off']]

Enables or disables the absolute redirect functionality of nginx

Default value: undef

auth_basic

Data type: Optional[String]

This directive includes testing name and password with HTTP Basic Authentication.

Default value: undef

auth_basic_user_file

Data type: Optional[String]

This directive sets the htpasswd filename for the authentication realm.

Default value: undef

auth_request

Data type: Optional[String]

This allows you to specify a custom auth endpoint

Default value: undef

priority

Data type: Integer[401,599]

Location priority. User priority 401-499, 501-599. If the priority is higher than the default priority (500), the location will be defined after root, or before root.

Default value: 500

mp4

Data type: Boolean

Indicates whether or not this loation can be used for mp4 streaming. Default: false

Default value: false

flv

Data type: Boolean

Indicates whether or not this loation can be used for flv streaming. Default: false

Default value: false

expires

Data type: Optional[String]

Setup expires time for locations content

Default value: undef

add_header

Data type: Hash

Adds headers to the location block. If any are specified, locations will no longer inherit headers from the parent server context

Default value: {}

gzip_static

Data type: Optional[Enum['on', 'off', 'always']]

Defines gzip_static, nginx default is off

Default value: undef

reset_timedout_connection

Data type: Optional[Enum['on', 'off']]

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

Default value: undef

fastcgi_index

Data type: Optional[String]

Default value: undef

rewrite_rules

Data type: Array

Default value: []

nginx::resource::mailhost

Define a mailhost

Examples

SMTP server definition
nginx::resource::mailhost { 'domain1.example':
  ensure      => present,
  auth_http   => 'server2.example/cgi-bin/auth',
  protocol    => 'smtp',
  listen_port => 587,
  ssl_port    => 465,
  starttls    => 'only',
  xclient     => 'off',
  ssl         => true,
  ssl_cert    => '/tmp/server.crt',
  ssl_key     => '/tmp/server.pem',
}

Parameters

The following parameters are available in the nginx::resource::mailhost defined type.

ensure

Data type: Enum['absent', 'present']

Enables or disables the specified mailhost

Default value: 'present'

listen_ip

Data type: Variant[Array[String], String]

Default IP Address for NGINX to listen with this server on. Defaults to all interfaces (*)

Default value: '*'

listen_port

Data type: Stdlib::Port

Default IP Port for NGINX to listen with this server on.

listen_options

Data type: Optional[String]

Extra options for listen directive like 'default' to catchall.

Default value: undef

ipv6_enable

Data type: Boolean

value to enable/disable IPv6 support (false|true). Module will check to see if IPv6 support exists on your system before enabling.

Default value: false

ipv6_listen_ip

Data type: Variant[Array[String], String]

Default IPv6 Address for NGINX to listen with this server on. Defaults to all interfaces (::)

Default value: '::'

ipv6_listen_port

Data type: Stdlib::Port

Default IPv6 Port for NGINX to listen with this server on.

Default value: $listen_port

ipv6_listen_options

Data type: String

Extra options for listen directive like 'default' to catchall. Template will allways add ipv6only=on. While issue voxpupuli#30 is discussed, default value is 'default'.

Default value: 'default ipv6only=on'

ssl

Data type: Boolean

Indicates whether to setup SSL bindings for this mailhost.

Default value: false

ssl_cert

Data type: Optional[String]

Pre-generated SSL Certificate file to reference for SSL Support. This is not generated by this module.

Default value: undef

ssl_ciphers

Data type: String

Override default SSL ciphers.

Default value: $nginx::ssl_ciphers

ssl_client_cert

Data type: Optional[String]

Pre-generated SSL Certificate file to reference for client verify SSL Support. This is not generated by this module.

Default value: undef

ssl_crl

Data type: Optional[String]

String: Specifies CRL path in file system

Default value: undef

ssl_dhparam

Data type: Optional[String]

This directive specifies a file containing Diffie-Hellman key agreement protocol cryptographic parameters, in PEM format, utilized for exchanging session keys between server and client.

Default value: $nginx::ssl_dhparam

ssl_ecdh_curve

Data type: Optional[String]

This directive specifies a curve for ECDHE ciphers.

Default value: undef

ssl_key

Data type: Optional[String]

Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module.

Default value: undef

ssl_password_file

Data type: Optional[String]

This directive specifies a file containing passphrases for secret keys.

Default value: undef

ssl_port

Data type: Optional[Stdlib::Port]

Default IP Port for NGINX to listen with this SSL server on.

Default value: undef

ssl_prefer_server_ciphers

Data type: Enum['on', 'off']

Specifies that server ciphers should be preferred over client ciphers when using the SSLv3 and TLS protocols.

Default value: $nginx::ssl_prefer_server_ciphers

ssl_protocols

Data type: String

SSL protocols enabled.

Default value: $nginx::ssl_protocols

ssl_session_cache

Data type: Optional[String]

Sets the type and size of the session cache.

Default value: undef

ssl_session_ticket_key

Data type: Optional[String]

This directive specifies a file containing secret key used to encrypt and decrypt TLS session tickets.

Default value: undef

ssl_session_tickets

Data type: Optional[String]

Whether to enable or disable session resumption through TLS session tickets.

Default value: undef

ssl_session_timeout

Data type: String

Specifies a time during which a client may reuse the session parameters stored in a cache.

Default value: '5m'

ssl_trusted_cert

Data type: Optional[String]

Specifies a file with trusted CA certificates in the PEM format used to verify client certificates and OCSP responses if ssl_stapling is enabled.

Default value: undef

ssl_verify_depth

Data type: Optional[Integer]

Sets the verification depth in the client certificates chain.

Default value: undef

starttls

Data type: Enum['on', 'off', 'only']

Enable STARTTLS support

Default value: 'off'

protocol

Data type: Optional[Enum['imap', 'pop3', 'smtp']]

Mail protocol to use

Default value: undef

auth_http

Data type: Optional[String]

With this directive you can set the URL to the external HTTP-like server for authorization.

Default value: undef

xclient

Data type: Enum['on', 'off']

Whether to use xclient for smtp

Default value: 'on'

imap_auth

Data type: Optional[String]

Sets permitted methods of authentication for IMAP clients.

Default value: undef

imap_capabilities

Data type: Optional[Array]

Sets the IMAP protocol extensions list that is passed to the client in response to the CAPA command.

Default value: undef

imap_client_buffer

Data type: Optional[String]

Sets the IMAP commands read buffer size.

Default value: undef

pop3_auth

Data type: Optional[String]

Sets permitted methods of authentication for POP3 clients.

Default value: undef

pop3_capabilities

Data type: Optional[Array]

Sets the POP3 protocol extensions list that is passed to the client in response to the CAPA command.

Default value: undef

smtp_auth

Data type: Optional[String]

Sets permitted methods of SASL authentication for SMTP clients.

Default value: undef

smtp_capabilities

Data type: Optional[Array]

Sets the SMTP protocol extensions list that is passed to the client in response to the EHLO command.

Default value: undef

proxy_pass_error_message

Data type: String

Indicates whether to pass the error message obtained during the authentication on the backend to the client.

Default value: 'off'

server_name

Data type: Array

List of mailhostnames for which this mailhost will respond.

Default value: [$name]

raw_prepend

Data type: Optional[Variant[Array, String]]

A single string, or an array of strings to prepend to the server directive (after mailhost_cfg_prepend directive). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

raw_append

Data type: Optional[Variant[Array, String]]

A single string, or an array of strings to append to the server directive (after mailhost_cfg_append directive). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

mailhost_cfg_append

Data type: Optional[Hash]

It expects a hash with custom directives to put after everything else inside server

Default value: undef

mailhost_cfg_prepend

Data type: Optional[Hash]

It expects a hash with custom directives to put before everything else inside server

Default value: undef

auth_http_header

Data type: Optional[String]

Default value: undef

nginx::resource::map

Create a new mapping entry for NGINX

Examples

nginx::resource::map { 'backend_pool':
  ensure    => present,
  hostnames => true,
  default   => 'ny-pool-1,
  string    => '$http_host',
  mappings  => {
    '*.nyc.example.com' => 'ny-pool-1',
    '*.sf.example.com'  => 'sf-pool-1',
  }
}
Preserving input of order of mappings
nginx::resource::map { 'backend_pool':
  ...
  mappings  => [
    { 'key' => '*.sf.example.com', 'value' => 'sf-pool-1' },
    { 'key' => '*.nyc.example.com', 'value' => 'ny-pool-1' },
  ]
}
Using external include
nginx::resource::map { 'redirections':
   include_files => [ '/etc/nginx/conf.d/redirections.map']
}
Hiera usage
nginx::string_mappings:
  client_network:
    ensure: present
    hostnames: true
    default: 'ny-pool-1'
    string: $http_host
    mappings:
      '*.nyc.example.com': 'ny-pool-1'
      '*.sf.example.com': 'sf-pool-1'
Hiera usage: preserving input of order of mappings:
nginx::string_mappings:
  client_network:
    ...
    mappings:
      - key: '*.sf.example.com'
        value: 'sf-pool-1'
      - key: '*.nyc.example.com'
        value: 'ny-pool-1'

Parameters

The following parameters are available in the nginx::resource::map defined type.

ensure

Data type: Enum['absent', 'present']

Enables or disables the specified location

Default value: 'present'

default

Data type: Optional[String]

Sets the resulting value if the source values fails to match any of the variants.

Default value: undef

string

Data type: String[2]

Source string or variable to provide mapping for

mappings

Data type: Variant[Array, Hash]

Hash of map lookup keys and resultant values

hostnames

Data type: Boolean

Indicates that source values can be hostnames with a prefix or suffix mask.

Default value: false

include_files

Data type: Array[String]

An array of external files to include

Default value: []

context

Data type: Enum['http', 'stream']

Specify if mapping is for http or stream context

Default value: 'http'

nginx::resource::server

Create a virtual host

Examples

nginx::resource::server { 'test2.local':
  ensure   => present,
  www_root => '/var/www/nginx-default',
  ssl      => true,
  ssl_cert => '/tmp/server.crt',
  ssl_key  => '/tmp/server.pem',
}

Parameters

The following parameters are available in the nginx::resource::server defined type.

ensure

Data type: Enum['absent', 'present']

Enables or disables the specified server

Default value: 'present'

listen_ip

Data type: Variant[Array, String]

Default IP Address for NGINX to listen with this server on. Defaults to all interfaces (*)

Default value: '*'

listen_port

Data type: Stdlib::Port

Default TCP Port for NGINX to listen with this server on.

Default value: 80

listen_options

Data type: Optional[String]

Extra options for listen directive like 'default_server' to catchall.

Default value: undef

listen_unix_socket_enable

Data type: Boolean

value to enable/disable UNIX socket listening support.

Default value: false

listen_unix_socket

Data type: Variant[Array[Stdlib::Absolutepath], Stdlib::Absolutepath]

Default unix socket for NGINX to listen with this server on.

Default value: '/var/run/nginx.sock'

listen_unix_socket_options

Data type: Optional[String]

Extra options for listen directive like 'default' to catchall.

Default value: undef

location_satisfy

Data type: Optional[Enum['any', 'all']]

Allows access if all (all) or at least one (any) of the auth modules allow access.

Default value: undef

location_allow

Data type: Array

Locations to allow connections from.

Default value: []

location_deny

Data type: Array

Locations to deny connections from.

Default value: []

ipv6_enable

Data type: Boolean

value to enable/disable IPv6 support (false|true). Module will check to see if IPv6 support exists on your system before enabling.

Default value: false

ipv6_listen_ip

Data type: Variant[Array, String]

Default IPv6 Address for NGINX to listen with this server on. Defaults to all interfaces (::)

Default value: '::'

ipv6_listen_port

Data type: Stdlib::Port

Default IPv6 Port for NGINX to listen with this server on. Defaults to TCP 80

Default value: $listen_port

ipv6_listen_options

Data type: String

Extra options for listen directive like 'default' to catchall. Template will allways add ipv6only=on. While issue voxpupuli#30 is discussed, default value is 'default'.

Default value: 'default ipv6only=on'

add_header

Data type: Hash

Adds headers to the HTTP response when response code is equal to 200, 204, 301, 302 or 304.

Default value: {}

index_files

Data type: Array

Default index files for NGINX to read when traversing a directory

Default value: [ 'index.html', 'index.htm', 'index.php', ]

autoindex

Data type: Optional[String]

Set it on 'on' or 'off 'to activate/deactivate autoindex directory listing.

Default value: undef

autoindex_exact_size

Data type: Optional[Enum['on', 'off']]

Set it on 'on' or 'off' to activate/deactivate autoindex displaying exact filesize, or rounded to kilobytes, megabytes and gigabytes.

Default value: undef

autoindex_format

Data type: Optional[Enum['html', 'xml', 'json', 'jsonp']]

Sets the format of a directory listing.

Default value: undef

autoindex_localtime

Data type: Optional[Enum['on', 'off']]

Specifies whether times in the directory listing should be output in the local time zone or UTC.

Default value: undef

reset_timedout_connection

Data type: Optional[Enum['on', 'off']]

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

Default value: undef

proxy

Data type: Optional[String]

Proxy server(s) for the root location to connect to. Accepts a single value, can be used in conjunction with nginx::resource::upstream

Default value: undef

proxy_read_timeout

Data type: String

Override the default proxy read timeout value of 90 seconds

Default value: $nginx::proxy_read_timeout

proxy_send_timeout

Data type: String

Override the default proxy send timeout value of 90 seconds

Default value: $nginx::proxy_send_timeout

proxy_redirect

Data type: Optional[String]

Override the default proxy_redirect value of off.

Default value: undef

proxy_buffering

Data type: Optional[String]

If defined, sets the proxy_buffering to the passed value.

Default value: undef

proxy_request_buffering

Data type: Optional[String]

If defined, sets the proxy_request_buffering to the passed value.

Default value: undef

proxy_max_temp_file_size

Data type: Optional[Nginx::Size]

Sets the maximum size of the temporary buffer file.

Default value: undef

proxy_busy_buffers_size

Data type: Optional[Nginx::Size]

Sets the total size of buffers that can be busy sending a response to the client while the response is not yet fully read.

Default value: undef

resolver

Data type: Array

Configures name servers used to resolve names of upstream servers into addresses.

Default value: []

fastcgi

Data type: Optional[String]

location of fastcgi (host:port)

Default value: undef

fastcgi_param

Data type: Any

Set additional custom fastcgi_params

Default value: undef

fastcgi_params

Data type: String

optional alternative fastcgi_params file to use

Default value: "${nginx::conf_dir}/fastcgi.conf"

fastcgi_index

Data type: Optional[String]

optional FastCGI index page

Default value: undef

fastcgi_script

Data type: Optional[String]

optional SCRIPT_FILE parameter

Default value: undef

uwsgi_read_timeout

Data type: Optional[String]

optional value for uwsgi_read_timeout

Default value: undef

ssl

Data type: Boolean

Indicates whether to setup SSL bindings for this server.

Default value: false

ssl_cert

Data type: Optional[Variant[String, Boolean, Array[String]]]

Pre-generated SSL Certificate file to reference for SSL Support. This is not generated by this module. Set to false to inherit from the http section, which improves performance by conserving memory. Use an array to add multiple SSL Certificates.

Default value: undef

ssl_client_cert

Data type: Optional[String]

Pre-generated SSL Certificate file to reference for client verify SSL Support. This is not generated by this module.

Default value: undef

ssl_verify_client

Data type: String

Enables verification of client certificates.

Default value: 'on'

ssl_crl

Data type: Optional[String]

Specifies CRL path in file system

Default value: undef

ssl_dhparam

Data type: Optional[String]

This directive specifies a file containing Diffie-Hellman key agreement protocol cryptographic parameters, in PEM format, utilized for exchanging session keys between server and client.

Default value: undef

ssl_ecdh_curve

Data type: Optional[String]

This directive specifies a curve for ECDHE ciphers.

Default value: undef

ssl_prefer_server_ciphers

Data type: Optional[Enum['on', 'off']]

String: Specifies that server ciphers should be preferred over client ciphers when using the SSLv3 and TLS protocols.

Default value: undef

ssl_redirect

Data type: Boolean

Adds a server directive and return statement to force ssl redirect. Will honor ssl_port if it's set.

Default value: false

ssl_redirect_port

Data type: Optional[Integer]

Overrides $ssl_port in the SSL redirect set by ssl_redirect

Default value: undef

ssl_key

Data type: Optional[Variant[String, Boolean, Array[String]]]

Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module. Set to false to inherit from the http section, which improves performance by conserving memory. Use an array to add multiple SSL Keys.

Default value: undef

ssl_port

Data type: Integer

Default IP Port for NGINX to listen with this SSL server on.

Default value: 443

ssl_protocols

Data type: Optional[String]

SSL protocols enabled. Defaults to 'TLSv1 TLSv1.1 TLSv1.2'.

Default value: undef

ssl_buffer_size

Data type: Optional[String]

Sets the size of the buffer used for sending data.

Default value: undef

ssl_ciphers

Data type: Optional[String]

SSL ciphers enabled.

Default value: undef

ssl_stapling

Data type: Boolean

Enables or disables stapling of OCSP responses by the server.

Default value: false

ssl_stapling_file

Data type: Optional[String]

When set, the stapled OCSP response will be taken from the specified file instead of querying the OCSP responder specified in the server certificate.

Default value: undef

ssl_stapling_responder

Data type: Optional[String]

Overrides the URL of the OCSP responder specified in the Authority Information Access certificate extension.

Default value: undef

ssl_stapling_verify

Data type: Boolean

Enables or disables verification of OCSP responses by the server. Defaults to false.

Default value: false

ssl_session_timeout

Data type: Optional[String]

Specifies a time during which a client may reuse the session parameters stored in a cache. Defaults to 5m.

Default value: undef

ssl_session_tickets

Data type: Optional[Enum['on', 'off']]

Enables or disables session resumption through TLS session tickets.

Default value: undef

ssl_session_ticket_key

Data type: Optional[String]

Sets a file with the secret key used to encrypt and decrypt TLS session tickets.

Default value: undef

ssl_trusted_cert

Data type: Optional[String]

Specifies a file with trusted CA certificates in the PEM format used to verify client certificates and OCSP responses if ssl_stapling is enabled.

Default value: undef

ssl_verify_depth

Data type: Optional[Integer]

Sets the verification depth in the client certificates chain.

Default value: undef

ssl_password_file

Data type: Optional[Stdlib::Absolutepath]

File containing the password for the SSL Key file.

Default value: undef

spdy

Data type: Enum['on', 'off']

Toggles SPDY protocol.

Default value: $nginx::spdy

http2

Data type: Enum['on', 'off']

Toggles HTTP/2 protocol.

Default value: $nginx::http2

server_name

Data type: Array[String]

List of servernames for which this server will respond. Default [$name].

Default value: [$name]

www_root

Data type: Optional[String]

Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy

Default value: undef

rewrite_www_to_non_www

Data type: Boolean

Adds a server directive and rewrite rule to rewrite www.domain.com to domain.com in order to avoid duplicate content (SEO);

Default value: false

rewrite_non_www_to_www

Data type: Boolean

Adds a server directive and rewrite rule to rewrite domain.com to www.domain.com in order to avoid duplicate content (SEO);

Default value: false

try_files

Data type: Optional[Array[String]]

Specifies the locations for files to be checked as an array. Cannot be used in conjuction with $proxy.

Default value: undef

proxy_cache

Data type: Optional[String]

This directive sets name of zone for caching. The same zone can be used in multiple places.

Default value: undef

proxy_cache_key

Data type: Optional[String]

Override the default proxy_cache_key of $scheme$proxy_host$request_uri

Default value: undef

proxy_cache_use_stale

Data type: Optional[String]

Override the default proxy_cache_use_stale value of off.

Default value: undef

proxy_cache_valid

Data type: Optional[Variant[Array[String], String]]

This directive sets the time for caching different replies.

Default value: undef

proxy_cache_lock

Data type: Optional[Enum['on', 'off']]

This directive sets the locking mechanism for pouplating cache.

Default value: undef

proxy_cache_bypass

Data type: Optional[Variant[Array[String], String]]

Defines conditions which the response will not be cached

Default value: undef

proxy_method

Data type: Optional[String]

If defined, overrides the HTTP method of the request to be passed to the backend.

Default value: undef

proxy_http_version

Data type: Optional[String]

Sets the proxy http version

Default value: undef

proxy_set_body

Data type: Optional[String]

If defined, sets the body passed to the backend.

Default value: undef

absolute_redirect

Data type: Optional[Enum['on', 'off']]

Enables or disables the absolute redirect functionality of nginx

Default value: undef

auth_basic

Data type: Optional[String]

This directive includes testing name and password with HTTP Basic Authentication.

Default value: undef

auth_basic_user_file

Data type: Optional[String]

This directive sets the htpasswd filename for the authentication realm.

Default value: undef

auth_request

Data type: Optional[String]

This allows you to specify a custom auth endpoint

Default value: undef

client_max_body_size

Data type: Any

This directive sets client_max_body_size.

Default value: undef

client_body_timeout

Data type: Optional[String]

Sets how long the server will wait for a client body. Default is 60s

Default value: undef

client_header_timeout

Data type: Optional[String]

Sets how long the server will wait for a client header. Default is 60s

Default value: undef

raw_prepend

Data type: Optional[Variant[Array[String], String]]

A single string, or an array of strings to prepend to the server directive (after cfg prepend directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

raw_append

Data type: Optional[Variant[Array[String], String]]

A single string, or an array of strings to append to the server directive (after cfg append directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

location_raw_prepend

Data type: Optional[Variant[Array[String], String]]

A single string, or an array of strings to prepend to the location directive (after custom_cfg directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

location_raw_append

Data type: Optional[Variant[Array[String], String]]

A single string, or an array of strings to append to the location directive (after custom_cfg directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: undef

server_cfg_append

Data type: Optional[Hash]

It expects a hash with custom directives to put after everything else inside server

Default value: undef

server_cfg_prepend

Data type: Optional[Hash]

It expects a hash with custom directives to put before everything else inside server

Default value: undef

server_cfg_ssl_append

Data type: Optional[Hash]

It expects a hash with custom directives to put after everything else inside server ssl

Default value: undef

server_cfg_ssl_prepend

Data type: Optional[Hash]

It expects a hash with custom directives to put before everything else inside server ssl

Default value: undef

include_files

Data type: Optional[Array[String]]

Adds include files to server

Default value: undef

access_log

Data type: Optional[Variant[String, Array]]

Where to write access log (log format can be set with $format_log). This can be either a string or an array; in the latter case, multiple lines will be created. Additionally, unlike the earlier behavior, setting it to 'absent' in the server context will remove this directive entirely from the server stanza, rather than setting a default. Can also be disabled for this server with the string 'off'.

Default value: undef

error_log

Data type: Optional[Variant[String, Array]]

Where to write error log. May add additional options like error level to the end. May set to 'absent', in which case it will be omitted in this server stanza (and default to nginx.conf setting)

Default value: undef

passenger_cgi_param

Data type: Optional[Hash]

Allows one to define additional CGI environment variables to pass to the backend application

Default value: undef

passenger_set_header

Data type: Optional[Hash]

Allows one to set headers to pass to the backend application (Passenger 5.0+)

Default value: undef

passenger_env_var

Data type: Optional[Hash]

Allows one to set environment variables to pass to the backend application (Passenger 5.0+)

Default value: undef

passenger_pre_start

Data type: Optional[Variant[Array[String], String]]

Allows setting a URL to pre-warm the host. Per Passenger docs, the "domain part of the URL" must match a value of server_name. If this is an array, multiple URLs can be specified.

Default value: undef

log_by_lua

Data type: Optional[String]

Run the Lua source code inlined as the at the log request processing phase. This does not replace the current access logs, but runs after.

Default value: undef

log_by_lua_file

Data type: Optional[String]

Equivalent to log_by_lua, except that the file specified by contains the Lua code, or, as from the v0.5.0rc32 release, the Lua/LuaJIT bytecode to be executed.

Default value: undef

gzip_types

Data type: Optional[String]

Defines gzip_types, nginx default is text/html

Default value: undef

gzip_static

Data type: Optional[String]

Defines gzip_static, nginx default is off

Default value: undef

owner

Data type: String

Defines owner of the .conf file

Default value: $nginx::global_owner

group

Data type: String

Defines group of the .conf file

Default value: $nginx::global_group

mode

Data type: String

Defines mode of the .conf file

Default value: $nginx::global_mode

maintenance

Data type: Boolean

A boolean value to set a server in maintenance

Default value: false

maintenance_value

Data type: String

Value to return when maintenance is on.

Default value: 'return 503'

error_pages

Data type: Any

Setup errors pages, hash key is the http code and hash value the page

Default value: undef

locations

Data type: Hash

Hash of location resources used by this server

Default value: {}

locations_defaults

Data type: Hash

Hash of location default settings

Default value: {}

ssl_listen_option

Data type: Boolean

Default value: true

ssl_cache

Data type: Optional[String]

Default value: undef

proxy_connect_timeout

Data type: Any

Default value: $nginx::proxy_connect_timeout

proxy_set_header

Data type: Array[String]

Default value: $nginx::proxy_set_header

proxy_hide_header

Data type: Array[String]

Default value: $nginx::proxy_hide_header

proxy_pass_header

Data type: Array[String]

Default value: $nginx::proxy_pass_header

uwsgi

Data type: Optional[String]

Default value: undef

uwsgi_params

Data type: String

Default value: "${nginx::config::conf_dir}/uwsgi_params"

location_custom_cfg

Data type: Optional[Hash]

Default value: undef

location_cfg_prepend

Data type: Optional[Hash]

Default value: undef

location_cfg_append

Data type: Optional[Hash]

Default value: undef

location_custom_cfg_prepend

Data type: Optional[Hash]

Default value: undef

location_custom_cfg_append

Data type: Optional[Hash]

Default value: undef

format_log

Data type: Optional[String]

Default value: $nginx::http_format_log

use_default_location

Data type: Any

Default value: true

rewrite_rules

Data type: Any

Default value: []

string_mappings

Data type: Any

Default value: {}

geo_mappings

Data type: Any

Default value: {}

nginx::resource::snippet

Create a reusable config snippet that can be included by other resources

Parameters

The following parameters are available in the nginx::resource::snippet defined type.

ensure

Data type: Enum['absent', 'present']

Enables or disables the specified snippet

Default value: 'present'

owner

Data type: String

Defines owner of the .conf file

Default value: $nginx::global_owner

group

Data type: String

Defines group of the .conf file

Default value: $nginx::global_group

mode

Data type: Stdlib::Filemode

Defines mode of the .conf file

Default value: $nginx::global_mode

raw_content

Data type: String[1]

Raw content that will be inserted into the snipped as-is

nginx::resource::streamhost

Create a virtual steamhost

Examples

nginx::resource::streamhost { 'test2.local':
  ensure   => present,
}

Parameters

The following parameters are available in the nginx::resource::streamhost defined type.

ensure

Data type: Enum['absent', 'present']

Enables or disables the specified streamhost

Default value: 'present'

listen_ip

Data type: Variant[Array, String]

Default IP Address for NGINX to listen with this streamhost on. Defaults to all interfaces (*)

Default value: '*'

listen_port

Data type: Integer

Default TCP Port for NGINX to listen with this streamhost on.

Default value: 80

listen_options

Data type: Optional[String]

Extra options for listen directive like 'default' to catchall.

Default value: undef

ipv6_enable

Data type: Boolean

Value to enable/disable IPv6 support Module will check to see if IPv6 support exists on your system before enabling.

Default value: false

ipv6_listen_ip

Data type: Variant[Array, String]

Default IPv6 Address for NGINX to listen with this streamhost on. Defaults to all interfaces (::)

Default value: '::'

ipv6_listen_port

Data type: Integer

Default IPv6 Port for NGINX to listen with this streamhost on.

Default value: $listen_port

ipv6_listen_options

Data type: String

Extra options for listen directive like 'default' to catchall. Template will allways add ipv6only=on. While issue voxpupuli#30 is discussed, default value is 'default'.

Default value: 'default ipv6only=on'

proxy

Data type: Any

Proxy server(s) for the root location to connect to. Accepts a single value, can be used in conjunction with nginx::resource::upstream

Default value: undef

proxy_read_timeout

Data type: String

Override the default the proxy read timeout value of 90 seconds

Default value: $nginx::proxy_read_timeout

resolver

Data type: Array

Configures name servers used to resolve names of upstream servers into addresses.

Default value: []

raw_prepend

Data type: Variant[Array[String], String]

A single string, or an array of strings to prepend to the server directive (after cfg prepend directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: []

raw_append

Data type: Variant[Array[String], String]

A single string, or an array of strings to append to the server directive (after cfg append directives). NOTE: YOU are responsible for a semicolon on each line that requires one.

Default value: []

owner

Data type: String

Defines owner of the .conf file

Default value: $nginx::global_owner

group

Data type: String

Defines group of the .conf file

Default value: $nginx::global_group

mode

Data type: String

Defines mode of the .conf file Default to return 503

Default value: $nginx::global_mode

proxy_connect_timeout

Data type: Any

Default value: $nginx::proxy_connect_timeout

nginx::resource::upstream

Create a new upstream proxy entry for NGINX

Examples

nginx::resource::upstream { 'proxypass':
  ensure  => present,
  members => {
    'localhost:3001' => {
      server => 'localhost',
      port   => 3001,
    },
    'localhost:3002' => {
      server => 'localhost',
      port   => 3002,
    },
    'localhost:3003' => {
      server => 'localhost',
      port   => 3003,
    },
  },
}
Custom config example to use ip_hash, and 20 keepalive connections create a hash with any extra custom config you want.
nginx::resource::upstream { 'proxypass':
  ensure    => present,
  members   => {
    'localhost:3001' => {
      server => 'localhost',
      port   => 3001,
    },
    'localhost:3002' => {
      server => 'localhost',
      port   => 3002,
    },
    'localhost:3003' => {
      server => 'localhost',
      port   => 3003,
    },
  },
  ip_hash   => true,
  keepalive => 20,
}

Parameters

The following parameters are available in the nginx::resource::upstream defined type.

ensure

Data type: Enum['present', 'absent']

Enables or disables the specified location

Default value: 'present'

context

Data type: Enum['http', 'stream']

Set the type of this upstream.

Default value: 'http'

members

Data type: Nginx::UpstreamMembers

Hash of member URIs for NGINX to connect to. Must follow valid NGINX syntax. If omitted, individual members should be defined with nginx::resource::upstream::member

Default value: {}

members_tag

Data type: Optional[String[1]]

Restrict collecting the exported members for this upstream with a tag.

Default value: undef

member_defaults

Data type: Nginx::UpstreamMemberDefaults

Specify default settings added to each member of this upstream.

Default value: {}

hash

Data type: Optional[String[1]]

Activate the hash load balancing method (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash).

Default value: undef

ip_hash

Data type: Boolean

Activate ip_hash for this upstream (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#ip_hash).

Default value: false

keepalive

Data type: Optional[Integer[1]]

Set the maximum number of idle keepalive connections (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive).

Default value: undef

keepalive_requests

Data type: Optional[Integer[1]]

Sets the maximum number of requests that can be served through one keepalive connection (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_requests).

Default value: undef

keepalive_timeout

Data type: Optional[Nginx::Time]

Sets a timeout during which an idle keepalive connection to an upstream server will stay open (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_timeout).

Default value: undef

least_conn

Data type: Boolean

Activate the least_conn load balancing method (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#least_conn).

Default value: false

least_time

Data type: Optional[Nginx::UpstreamLeastTime]

Activate the least_time load balancing method (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#least_time).

Default value: undef

ntlm

Data type: Boolean

Allow NTLM authentication (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#ntlm).

Default value: false

queue_max

Data type: Optional[Integer]

Set the maximum number of queued requests (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#queue).

Default value: undef

queue_timeout

Data type: Optional[Nginx::Time]

Set the timeout for the queue (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#queue).

Default value: undef

random

Data type: Optional[String[1]]

Activate the random load balancing method (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#random).

Default value: undef

statefile

Data type: Optional[Stdlib::Unixpath]

Specifies a file that keeps the state of the dynamically configurable group (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#state).

Default value: undef

sticky

Data type: Optional[Nginx::UpstreamSticky]

Enables session affinity (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#sticky).

Default value: undef

zone

Data type: Optional[Nginx::UpstreamZone]

Defines the name and optional the size of the shared memory zone (https://nginx.org/en/docs/http/ngx_http_upstream_module.html#zone).

Default value: undef

cfg_append

Data type: Nginx::UpstreamCustomParameters

Hash of custom directives to put after other directives in upstream

Default value: {}

cfg_prepend

Data type: Nginx::UpstreamCustomParameters

It expects a hash with custom directives to put before anything else inside upstream

Default value: {}

nginx::resource::upstream::member

Export this resource in all upstream member servers and collect them on the NGINX server. Exporting resources requires storeconfigs on the Puppetserver to export and collect resources

Examples

Exporting the resource on a upstream member server:
@@nginx::resource::upstream::member { $trusted['certname']:
  ensure   => present,
  upstream => 'proxypass',
  server   => $facts['networking']['ip'],
  port     => 3000,
}
Collecting the resource on the NGINX server:
nginx::resource::upstream { 'proxypass':
  ensure => present,
}

Parameters

The following parameters are available in the nginx::resource::upstream::member defined type.

upstream

Data type: String[1]

The name of the upstream resource

ensure

Data type: Enum['present', 'absent']

Enables or disables the specified member

Default value: 'present'

context

Data type: Enum['http', 'stream']

Set the type of this upstream

Default value: 'http'

server

Data type: Optional[Nginx::UpstreamMemberServer]

Hostname or IP of the upstream member server

Default value: $name

port

Data type: Stdlib::Port

Port of the listening service on the upstream member

Default value: 80

weight

Data type: Optional[Integer[1]]

Set the weight for this upstream member

Default value: undef

max_conns

Data type: Optional[Integer[1]]

Set the max_conns for this upstream member

Default value: undef

max_fails

Data type: Optional[Integer[0]]

Set the max_fails for this upstream member

Default value: undef

fail_timeout

Data type: Optional[Nginx::Time]

Set the fail_timeout for this upstream member

Default value: undef

backup

Data type: Boolean

Activate backup for this upstream member

Default value: false

resolve

Data type: Boolean

Activate resolve for this upstream member

Default value: false

route

Data type: Optional[String[1]]

Set the route for this upstream member

Default value: undef

service

Data type: Optional[String[1]]

Set the service for this upstream member

Default value: undef

slow_start

Data type: Optional[Nginx::Time]

Set the slow_start for this upstream member

Default value: undef

state

Data type: Optional[Enum['drain','down']]

Set the state for this upstream member

Default value: undef

params_prepend

Data type: Optional[String[1]]

prepend a parameter for this upstream member

Default value: undef

params_append

Data type: Optional[String[1]]

append a paremeter for this upstream member

Default value: undef

comment

Data type: Optional[String[1]]

Add a comment for this upstream member

Default value: undef

Data types

Nginx::DebugConnection

The Nginx::DebugConnection data type.

Alias of Variant[Stdlib::Host, Stdlib::IP::Address, Enum['unix:']]

Nginx::ErrorLogSeverity

The Nginx::ErrorLogSeverity data type.

Alias of Enum['debug', 'info', 'notice', 'warn', 'error', 'crit', 'alert', 'emerg']

Nginx::Size

The Nginx::Size data type.

Alias of Pattern[/^\d+[k|K|m|M]?$/]

Nginx::Time

The Nginx::Time data type.

Alias of Pattern[/^\d+(ms|s|m|h|d|w|M|y)?$/]

Nginx::UpstreamCustomParameters

The Nginx::UpstreamCustomParameters data type.

Alias of Hash[String[1], Variant[ String[1], Integer, Array[ Variant[ String[1], Integer ] ], Hash[String[1], Variant[ String[1], Integer, Array[ Variant[ String[1], Integer, ] ] ] ] ]]

Nginx::UpstreamDefaults

The Nginx::UpstreamDefaults data type.

Alias of Struct[{ context => Optional[Enum['http', 'stream']], member_defaults => Optional[Nginx::UpstreamMemberDefaults], hash => Optional[String], ip_hash => Optional[Boolean], keepalive => Optional[Integer[1]], kepalive_requests => Optional[Integer[1]], keepalive_timeout => Optional[Nginx::Time], least_conn => Optional[Boolean], least_time => Optional[Nginx::UpstreamLeastTime], ntlm => Optional[Boolean], queue_max => Optional[Integer], queue_timeout => Optional[Nginx::Time], random => Optional[String], statefile => Optional[Stdlib::Unixpath], sticky => Optional[Nginx::UpstreamSticky], zone => Optional[Nginx::UpstreamZone], cfg_append => Optional[Hash], cfg_prepend => Optional[Hash], }]

Nginx::UpstreamLeastTime

The Nginx::UpstreamLeastTime data type.

Alias of Variant[Nginx::UpstreamLeastTimeHttp, Nginx::UpstreamLeastTimeStream]

Nginx::UpstreamLeastTimeHttp

The Nginx::UpstreamLeastTimeHttp data type.

Alias of Enum['header', 'header inflight', 'last_byte', 'last_byte inflight']

Nginx::UpstreamLeastTimeStream

The Nginx::UpstreamLeastTimeStream data type.

Alias of Enum['connect', 'connect inflight', 'first_byte', 'first_byte inflight', 'last_byte', 'last_byte inflight']

Nginx::UpstreamMember

The Nginx::UpstreamMember data type.

Alias of Struct[{ server => Optional[Nginx::UpstreamMemberServer], port => Optional[Stdlib::Port], weight => Optional[Integer[1]], max_conns => Optional[Integer[1]], max_fails => Optional[Integer[0]], fail_timeout => Optional[Nginx::Time], backup => Optional[Boolean], resolve => Optional[Boolean], route => Optional[String], service => Optional[String], slow_start => Optional[Nginx::Time], state => Optional[Enum['drain','down']], params_prepend => Optional[String], params_append => Optional[String], comment => Optional[String], }]

Nginx::UpstreamMemberDefaults

The Nginx::UpstreamMemberDefaults data type.

Alias of Struct[{ server => Optional[Nginx::UpstreamMemberServer], port => Optional[Stdlib::Port], weight => Optional[Integer[1]], max_conns => Optional[Integer[1]], max_fails => Optional[Integer[0]], fail_timeout => Optional[Nginx::Time], backup => Optional[Boolean], resolve => Optional[Boolean], route => Optional[String], service => Optional[String], slow_start => Optional[Nginx::Time], state => Optional[Enum['drain','down']], params_prepend => Optional[String], params_append => Optional[String], }]

Nginx::UpstreamMemberServer

The Nginx::UpstreamMemberServer data type.

Alias of Variant[Stdlib::Host, Pattern[/^unix:\/([^\/\0]+\/*)[^:]*$/]]

Nginx::UpstreamMembers

The Nginx::UpstreamMembers data type.

Alias of Hash[String, Nginx::UpstreamMember]

Nginx::UpstreamSticky

The Nginx::UpstreamSticky data type.

Alias of Variant[Hash[ Enum['cookie'], Struct[{ name => String, expires => Optional[Variant[Nginx::Time,Enum['max']]], domain => Optional[String], httponly => Optional[Boolean], secure => Optional[Boolean], path => Optional[String], }] ], Hash[ Enum['route'], String ], Hash[ Enum['learn'], Struct[{ create => String, lookup => String, zone => Nginx::UpstreamStickyZone, timeout => Optional[Nginx::Time], header => Optional[Boolean], sync => Optional[Boolean], }] ]]

Nginx::UpstreamStickyZone

The Nginx::UpstreamStickyZone data type.

Alias of Pattern[/^[-_\.A-Za-z0-9]*:\d+[k|K|m|M]$/]

Nginx::UpstreamZone

The Nginx::UpstreamZone data type.

Alias of Pattern[/^[-_\.A-Za-z0-9]* \d+[k|K|m|M]$/]