2013-04-25 23:22:09 +02:00
|
|
|
# Class: nginx::param
|
2011-06-07 01:05:27 +02:00
|
|
|
#
|
|
|
|
# This module manages NGINX paramaters
|
|
|
|
#
|
|
|
|
# Parameters:
|
2011-06-15 21:40:42 +02:00
|
|
|
#
|
|
|
|
# There are no default parameters for this class.
|
2011-06-07 01:05:27 +02:00
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
#
|
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
# This class file is not called directly
|
2011-05-25 04:20:48 +02:00
|
|
|
class nginx::params {
|
2014-01-06 22:26:59 +01:00
|
|
|
|
2013-03-27 19:13:52 +01:00
|
|
|
$nx_temp_dir = '/tmp'
|
|
|
|
$nx_run_dir = '/var/nginx'
|
2011-06-15 21:40:42 +02:00
|
|
|
|
2014-03-10 21:19:25 +01:00
|
|
|
$nx_conf_template = 'nginx/conf.d/nginx.conf.erb'
|
2014-03-10 21:44:46 +01:00
|
|
|
$nx_proxy_conf_template = 'nginx/conf.d/proxy.conf.erb'
|
2013-03-27 19:13:52 +01:00
|
|
|
$nx_confd_purge = false
|
2014-03-07 20:39:40 +01:00
|
|
|
$nx_vhost_purge = false
|
2013-03-27 19:13:52 +01:00
|
|
|
$nx_worker_processes = 1
|
|
|
|
$nx_worker_connections = 1024
|
2014-03-12 18:17:41 +01:00
|
|
|
$nx_worker_rlimit_nofile = 1024
|
2013-05-21 14:30:21 +02:00
|
|
|
$nx_types_hash_max_size = 1024
|
|
|
|
$nx_types_hash_bucket_size = 512
|
2013-06-20 16:48:52 +02:00
|
|
|
$nx_names_hash_bucket_size = 64
|
2014-01-10 04:42:16 +01:00
|
|
|
$nx_names_hash_max_size = 512
|
2013-03-27 19:13:52 +01:00
|
|
|
$nx_multi_accept = off
|
2014-01-08 15:46:56 +01:00
|
|
|
# One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport]
|
|
|
|
# or false to use OS default
|
2013-07-21 02:12:18 +02:00
|
|
|
$nx_events_use = false
|
2013-03-27 19:13:52 +01:00
|
|
|
$nx_sendfile = on
|
|
|
|
$nx_keepalive_timeout = 65
|
|
|
|
$nx_tcp_nodelay = on
|
|
|
|
$nx_gzip = on
|
2013-05-21 14:30:21 +02:00
|
|
|
$nx_server_tokens = on
|
|
|
|
$nx_spdy = off
|
|
|
|
$nx_ssl_stapling = off
|
|
|
|
|
2011-06-15 21:40:42 +02:00
|
|
|
$nx_proxy_redirect = off
|
|
|
|
$nx_proxy_set_header = [
|
2013-04-24 10:42:06 +02:00
|
|
|
'Host $host',
|
|
|
|
'X-Real-IP $remote_addr',
|
2011-06-15 21:40:42 +02:00
|
|
|
'X-Forwarded-For $proxy_add_x_forwarded_for',
|
|
|
|
]
|
2013-05-21 14:30:21 +02:00
|
|
|
$nx_proxy_cache_path = false
|
|
|
|
$nx_proxy_cache_levels = 1
|
|
|
|
$nx_proxy_cache_keys_zone = 'd2:100m'
|
|
|
|
$nx_proxy_cache_max_size = '500m'
|
|
|
|
$nx_proxy_cache_inactive = '20m'
|
2011-06-15 21:40:42 +02:00
|
|
|
|
|
|
|
$nx_client_body_temp_path = "${nx_run_dir}/client_body_temp"
|
|
|
|
$nx_client_body_buffer_size = '128k'
|
|
|
|
$nx_client_max_body_size = '10m'
|
|
|
|
$nx_proxy_temp_path = "${nx_run_dir}/proxy_temp"
|
|
|
|
$nx_proxy_connect_timeout = '90'
|
|
|
|
$nx_proxy_send_timeout = '90'
|
|
|
|
$nx_proxy_read_timeout = '90'
|
|
|
|
$nx_proxy_buffers = '32 4k'
|
2013-05-06 11:40:46 +02:00
|
|
|
$nx_proxy_http_version = '1.0'
|
2013-09-06 00:15:45 +02:00
|
|
|
$nx_proxy_buffer_size = '8k'
|
2013-03-27 19:13:52 +01:00
|
|
|
|
2011-12-13 20:45:31 +01:00
|
|
|
$nx_logdir = $::kernel ? {
|
2011-06-15 21:40:42 +02:00
|
|
|
/(?i-mx:linux)/ => '/var/log/nginx',
|
2014-01-30 16:41:44 +01:00
|
|
|
/(?i-mx:sunos)/ => '/var/log/nginx',
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|
|
|
|
|
2011-12-13 20:45:31 +01:00
|
|
|
$nx_pid = $::kernel ? {
|
2011-06-15 21:40:42 +02:00
|
|
|
/(?i-mx:linux)/ => '/var/run/nginx.pid',
|
2014-01-30 16:41:44 +01:00
|
|
|
/(?i-mx:sunos)/ => '/var/run/nginx.pid',
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|
2011-06-07 00:25:04 +02:00
|
|
|
|
2014-03-20 23:00:56 +01:00
|
|
|
$nx_conf_dir = $::kernelversion ? {
|
|
|
|
/(?i-mx:joyent)/ => '/opt/local/etc/nginx',
|
2014-03-24 22:14:32 +01:00
|
|
|
default => '/etc/nginx',
|
2014-03-20 16:42:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if $::osfamily {
|
2014-03-20 23:00:56 +01:00
|
|
|
$solaris_nx_daemon_user = $::kernelversion ? {
|
|
|
|
/(?i-mx:joyent)/ => 'www',
|
2014-03-24 22:14:32 +01:00
|
|
|
default => 'webservd',
|
2014-03-20 23:00:56 +01:00
|
|
|
}
|
2013-11-18 17:29:44 +01:00
|
|
|
$nx_daemon_user = $::osfamily ? {
|
|
|
|
/(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx',
|
|
|
|
/(?i-mx:debian)/ => 'www-data',
|
2014-03-20 16:42:18 +01:00
|
|
|
/(?i-mx:solaris)/ => $solaris_nx_daemon_user,
|
2013-11-18 17:29:44 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
warning('$::osfamily not defined. Support for $::operatingsystem is deprecated')
|
|
|
|
warning("Please upgrade from factor ${::facterversion} to >= 1.7.2")
|
|
|
|
$nx_daemon_user = $::operatingsystem ? {
|
|
|
|
/(?i-mx:debian|ubuntu)/ => 'www-data',
|
|
|
|
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo|oraclelinux)/ => 'nginx',
|
2014-02-12 10:01:22 +01:00
|
|
|
/(?i-mx:solaris)/ => 'webservd',
|
2013-11-18 17:29:44 +01:00
|
|
|
}
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|
2012-09-30 22:29:55 +02:00
|
|
|
|
2013-07-21 02:12:18 +02:00
|
|
|
# Service restart after Nginx 0.7.53 could also be just
|
|
|
|
# "/path/to/nginx/bin -s HUP" Some init scripts do a configtest, some don't.
|
|
|
|
# If configtest_enable it's true then service restart will take
|
|
|
|
# $nx_service_restart value, forcing configtest.
|
|
|
|
|
2013-03-16 10:34:07 +01:00
|
|
|
$nx_configtest_enable = false
|
2013-05-08 14:15:42 +02:00
|
|
|
$nx_service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart'
|
2014-03-03 19:23:41 +01:00
|
|
|
$nx_service_ensure = running
|
2012-09-30 22:29:55 +02:00
|
|
|
|
add support for mail module
See http://wiki.nginx.org/Modules#Mail_modules
Sample Usage:
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',
}
2013-03-11 14:05:00 +01:00
|
|
|
$nx_mail = false
|
2012-09-30 22:29:55 +02:00
|
|
|
|
2013-07-21 02:12:18 +02:00
|
|
|
$nx_http_cfg_append = false
|
|
|
|
|
2013-08-08 03:27:13 +02:00
|
|
|
$nx_nginx_error_log = "${nx_logdir}/error.log"
|
|
|
|
$nx_http_access_log = "${nx_logdir}/access.log"
|
|
|
|
|
2013-09-27 14:48:51 +02:00
|
|
|
# package name depends on distribution, e.g. for Debian nginx-full | nginx-light
|
|
|
|
$package_name = 'nginx'
|
2013-09-05 10:01:00 +02:00
|
|
|
$package_ensure = 'present'
|
2013-09-27 14:48:51 +02:00
|
|
|
$package_source = 'nginx'
|
2013-09-26 15:32:59 +02:00
|
|
|
$manage_repo = true
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|