Version information
released Oct 30th 2018
This version is compatible with:
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'aneesh-nginx', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
aneesh/nginx — version 6.0.0 Oct 30th 2018
NGINX Module
Overview
This module install and configure nginx web server.
Usage
Default configuration:
include nginx
Change configuration file settings:
class { 'nginx':
user => 'nginx',
worker_processes => 'auto',
error_log => '/var/log/nginx/error.log',
pid => '/run/nginx.pid',
include => [ '/usr/share/nginx/modules/*.conf' ],
worker_connections => '1024',
access_log => '/var/log/nginx/access.log main',
sendfile => 'on',
tcp_nopush => 'on',
tcp_nodelay => 'on',
keepalive_timeout => '65',
types_hash_max_size => '2048',
default_type => 'application/octet-stream',
http_include => [ '/etc/nginx/mime.types', '/etc/nginx/conf.d/*.conf', '/etc/nginx/sites-enabled/*.conf' ],
server_tokens => 'off',
}
Create virtual server:
nginx::virtual_server { 'example.com.conf':
file_name => 'example.com.conf',
listen => [ '80' ],
server_name => 'example.com www.example.com',
server_tokens => 'off',
access_log => '/var/log/nginx/example.com-access.log',
error_log => '/var/log/nginx/example.com-error.log',
error_page => [ '404 /404.html', '500 502 503 504 /50x.html' ],
client_max_body_size => '2M',
location => {
'/' => [
'root /var/www/example.com/public_html/',
'index index.php index.html index.htm',
],
'~ \.php$' => [
'root /var/www/example.com/public_html/',
'fastcgi_pass 127.0.0.1:9000',
'fastcgi_index index.php',
'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name',
'include fastcgi_params',
],
'= /404.html' => [
'root /usr/share/nginx/html',
],
'= /50x.html' => [
'root /usr/share/nginx/html',
],
},
}
Copyright 2018 Aneesh C 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.