Version information
This module has been deprecated by its author since Oct 17th 2017.
The reason given was: puppet-nginx
The author has suggested puppet-nginx as its replacement.
Start using this module
Documentation
NGINX Module
James Fryman james@frymanet.com
This module manages NGINX configuration.
Quick Start
Install and bootstrap an NGINX instance
class { 'nginx': }
Setup a new virtual host
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
}
Add a Proxy Server
nginx::resource::upstream { 'puppet_rack_app':
ensure => present,
members => [
'localhost:3000',
'localhost:3001',
'localhost:3002',
],
}
nginx::resource::vhost { 'rack.puppetlabs.com':
ensure => present,
proxy => 'http://puppet_rack_app',
}
Add a smtp proxy
class { 'nginx':
mail => true,
}
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',
}
Hiera Support
Defining nginx resources in Hiera.
nginx::nginx_upstreams:
'puppet_rack_app':
ensure: present
members:
- localhost:3000
- localhost:3001
- localhost:3002
nginx::nginx_vhosts:
'www.puppetlabs.com':
www_root: '/var/www/www.puppetlabs.com'
'rack.puppetlabs.com':
ensure: present
proxy: 'http://puppet_rack_app'
nginx::nginx_locations:
'static':
location: '~ "^/static/[0-9a-fA-F]{8}\/(.*)$"'
vhost: www.puppetlabs.com
'userContent':
location: /userContent
vhost: www.puppetlabs.com
www_root: /var/www/html
Nginx with precompiled Passenger
Currently this works only for Debian family.
class { 'nginx':
package_source => 'passenger',
http_cfg_append => {
'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini',
}
}
Package source passenger
will add Phusion Passenger repository to APT sources.
For each virtual host you should specify which ruby should be used.
vhost_cfg_append => {
'passenger_enabled' => 'on',
'passenger_ruby' => '/usr/bin/ruby'
}
Puppet master served by Nginx and Passenger
Virtual host config for serving puppet master:
nginx::resource::vhost { 'puppet':
ensure => present,
server_name => ['puppet'],
listen_port => 8140,
ssl => true,
ssl_cert => '/var/lib/puppet/ssl/certs/example.com.pem',
ssl_key => '/var/lib/puppet/ssl/private_keys/example.com.pem',
ssl_port => 8140,
ssl_cache => 'shared:SSL:128m',
ssl_ciphers => 'SSLv2:-LOW:-EXPORT:RC4+RSA',
vhost_cfg_append => {
'passenger_enabled' => 'on',
'passenger_ruby' => '/usr/bin/ruby',
'ssl_crl' => '/var/lib/puppet/ssl/ca/ca_crl.pem',
'ssl_client_certificate' => '/var/lib/puppet/ssl/certs/ca.pem',
'ssl_verify_client' => 'optional',
'ssl_verify_depth' => 1,
},
www_root => '/etc/puppet/rack/public',
use_default_location => false,
access_log => '/var/log/nginx/puppet_access.log',
error_log => '/var/log/nginx/puppet_error.log',
passenger_cgi_param => {
'SSL_CLIENT_S_DN' => '$ssl_client_s_dn',
'SSL_CLIENT_VERIFY' => '$ssl_client_verify',
},
}
2011-12-23 Sam Bashton sam@bashton.com
- manifests/resource/location.pp,manifests/resource/vhost.pp, templates/vhost/vhost_location_fastcgi.erb: Add support for fastcgi
2011-06-06 James Fryman james@frymanet.com
-
Modulefile, README, files/README.markdown, lib/facter/README.markdown, lib/puppet/parser/functions/README.markdown, lib/puppet/provider/README.markdown, lib/puppet/type/README.markdown, manifests/README.markdown, templates/README.markdown, tests/upstream.pp, tests/vhost.pp, tests/vhost_ssl.erb: Updated Documentation
-
ChangeLog: Updated Changelog
-
lib/facter/ipv6.rb, manifests/config.pp, manifests/init.pp, manifests/package.pp, manifests/package/suse.pp, manifests/params.pp, manifests/resource/location.pp, manifests/resource/upstream.pp, manifests/resource/vhost.pp, manifests/service.pp, manifests/vhost.pp, templates/conf.d/nginx.conf.erb, templates/conf.d/proxy.conf.erb, templates/conf.d/upstream.erb, templates/nginx.conf.erb, templates/vhost.erb, templates/vhost/vhost_footer.erb, templates/vhost/vhost_header.erb, templates/vhost/vhost_location_directory.erb, templates/vhost/vhost_location_proxy.erb, templates/vhost/vhost_ssl_header.erb: Added SuSE Support
-
README, manifests/init.pp, manifests/package.pp, manifests/package/debian.pp, manifests/package/redhat.pp, manifests/vhost.pp, templates/vhost.erb: Updated Package Layout
-
lib/facter/ipv6.rb: Added IPV6 Fact Check for Linux distros
2011-06-02 James Fryman james@frymanet.com
- .gitignore, ChangeLog, Modulefile, files/centos/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL, manifests/config.pp, manifests/init.pp, manifests/install.pp, manifests/package.pp, manifests/params.pp, manifests/service.pp, manifests/vhost.pp, metadata.json, templates/nginx.conf.erb, templates/vhost.erb, templates/vhost.pp: Added vhost support
2011-05-24 James Fryman james@frymanet.com
- LICENSE, Modulefile, README, files/README.markdown, files/centos/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL, lib/facter/README.markdown, lib/puppet/parser/functions/README.markdown, lib/puppet/provider/README.markdown, lib/puppet/type/README.markdown, manifests/README.markdown, manifests/config.pp, manifests/init.pp, manifests/install.pp, manifests/params.pp, manifests/service.pp, manifests/vhost.pp, metadata.json, spec/README.markdown, spec/spec.opts, spec/spec_helper.rb, spec/unit/puppet/provider/README.markdown, spec/unit/puppet/type/README.markdown, templates/README.markdown, templates/nginx.conf.erb, templates/vhost.pp, tests/init.pp, tests/vhost.pp: 20110524 Work Snapshot
2011-05-23 James Fryman james@frymanet.com
- : Initial Repository Initilization
Dependencies
- puppetlabs/stdlib (>= 0.1.6)
- puppetlabs/apt (>= 1.0.0)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.