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 {
|
2011-06-15 21:40:42 +02:00
|
|
|
$nx_temp_dir = '/tmp'
|
|
|
|
$nx_run_dir = '/var/nginx'
|
|
|
|
|
|
|
|
$nx_conf_dir = '/etc/nginx'
|
2012-09-30 10:30:04 +02:00
|
|
|
$nx_confd_purge = false
|
2011-06-15 21:40:42 +02:00
|
|
|
$nx_worker_processes = 1
|
|
|
|
$nx_worker_connections = 1024
|
2013-05-14 04:46:06 +02:00
|
|
|
$nx_types_hash_max_size = 1024
|
|
|
|
$nx_types_hash_bucket_size = 512
|
2013-04-25 23:22:09 +02:00
|
|
|
$nx_multi_accept = off
|
|
|
|
$nx_events_use = false # One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport] or false to use OS default
|
2011-06-15 21:40:42 +02:00
|
|
|
$nx_sendfile = on
|
|
|
|
$nx_keepalive_timeout = 65
|
|
|
|
$nx_tcp_nodelay = on
|
|
|
|
$nx_gzip = on
|
2013-04-25 23:22:09 +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',
|
|
|
|
]
|
|
|
|
|
|
|
|
$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'
|
2011-06-15 21:40:42 +02: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',
|
|
|
|
}
|
|
|
|
|
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',
|
|
|
|
}
|
2011-06-07 00:25:04 +02:00
|
|
|
|
2011-12-13 20:45:31 +01:00
|
|
|
$nx_daemon_user = $::operatingsystem ? {
|
2013-04-24 10:42:06 +02:00
|
|
|
/(?i-mx:debian|ubuntu)/ => 'www-data',
|
2013-01-22 18:09:51 +01:00
|
|
|
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon)/ => 'nginx',
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|
2012-09-30 22:29:55 +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-05-08 14:15:42 +02:00
|
|
|
$nx_configtest_enable = false
|
|
|
|
$nx_service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart'
|
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
|
|
|
|
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|