Giter Site home page Giter Site logo

puppet-nginx's Introduction

# 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 4 definitions : 
	* nginx::config (http config snippet)
	* nginx::site (http site)
	* nginx::site_include (site includes)
	* nginx::fcgi::site (fcgi php site)

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",
         }

## CHANGELOG ##
- v0.2 : * ssl support

puppet-nginx's People

Contributors

antonbabenko avatar ashwoods avatar benoitcattie avatar kevinschoon avatar orthogonous avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.