forked from BenoitCattie/puppet-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
126 lines (90 loc) · 3.83 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Nginx Recipe #
Author : Benoit CATTIE <[email protected]>
Version : 0.2
Licence : Apache
Basic module for configuring nginx via puppet.
Based in part on apache2 module code by Sam Quigley <[email protected]>, Tim Stoop <[email protected]> and David Schmitt <[email protected]>
## Class: nginx ##
Parameters (used in nginx.conf.erb) :
* $nginx_user. Defaults to 'www-data'.
* $nginx_worker_processes. Defaults to '1'.
* $nginx_worker_connections. Defaults to '1024'.
Install nginx.
Create config directories :
* /etc/nginx/conf.d for http config snippet
* /etc/nginx/includes for sites includes
* /etc/nginx/sites-enabled
* /etc/nginx/sites-available
* /etc/nginx/ssl
Provide 8 definitions :
* nginx::config (http config snippet)
* nginx::site (http site)
* nginx::site_include (site includes)
* nginx::fcgi::site (fcgi php site)
* nginx::static
* nginx::magento_site
* nginx::drupal
* nginx::dav
Templates:
- nginx.conf.erb => /etc/nginx/nginx.conf
### Define nginx::config ###
Installs a config snippet in /etc/nginx/conf.d.
Parameters :
* ensure: typically set to "present" or "absent". Defaults to "present"
* content: set the content of the config snipppet. Defaults to 'template("nginx/${name}.conf.erb")'
* order: specifies the load order for this config snippet. Defaults to "500"
### Define: nginx::site ###
Install a nginx site in /etc/nginx/sites-available (and symlink in /etc/nginx/sites-enabled).
Parameters :
* ensure: typically set to "present" or "absent". Defaults to "present"
* content: site definition (should be a template).
### Define: nginx::site_include ###
Define: site_include
Define a site config include in /etc/nginx/includes
Parameters :
* ensure: typically set to "present" or "absent". Defaults to "present"
* content: include definition (should be a template).
## Class nginx::fcgi ##
Manage nginx fcgi configuration.
Provide nginx::fcgi::site
Templates :
* nginx/includes/fastcgi_params.erb
### Define: nginx::fcgi::site ###
Create a fcgi site config from template using parameters.
You can use my php5-fpm class to manage fastcgi servers.
Parameters :
* ensure: typically set to "present" or "absent". Defaults to "present"
* root: document root (Required)
* index: nginx index directive. Defaults to "index.php"
* fastcgi_pass : port or socket on which the FastCGI-server is listening (Required)
* server_name : server_name directive (could be an array)
* listen : address/port the server listen to. Defaults to 80. Auto enable ssl if 443
* access_log : custom acces logs. Defaults to /var/log/nginx/$name_access.log
* include : custom include for the site (could be an array). Include files must exists
to avoid nginx reload errors. Use with nginx::site_include
* ssl_certificate : ssl_certificate path. If empty auto-generating ssl cert
* ssl_certificate_key : ssl_certificate_key path. If empty auto-generating ssl cert key
See http://wiki.nginx.org for details.
Templates :
* nginx/fcgi_site.erb
Sample Usage :
include nginx
include nginx::fcgi
nginx::fcgi::site {"default":
root => "/var/www/nginx-default",
fastcgi_pass => "127.0.0.1:9000",
server_name => ["localhost", "$hostname", "$fqdn"],
}
nginx::fcgi::site {"default-ssl":
listen => "443",
root => "/var/www/nginx-default",
fastcgi_pass => "127.0.0.1:9000",
server_name => "$fqdn",
}
## Expires header
expires header is now removed from global nginx.conf for compatibility reasons.
If you want this header (and you WILL want it), set it in per server or per location config:
# http://developer.yahoo.com/performance/rules.html#expires
expires 1y;
## CHANGELOG ##
- v0.2 : * ssl support