Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Puppet Module to manage NGINX on various UNIXes
Branch: master

This branch is 3 commits ahead, 40 commits behind CarePilot:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


NGINX Module

Originally by James Fryman

This module manages NGINX from within Puppet. It manages installation of OS package, the running service and the placement of configuration files through exposed resources. These resources do not construct configuration files for you--except those which are delightfully simple--requiring a provided template.

This might sound like a bummer, but mimicking nginx's complex configuration language in puppet is a real horror show. Read on for a quick-start tutorial. The source code is well documented and should be readable by those new to puppet.

Quick Start

Install puppet-nginx into your modules (do this from the root of your primary puppet repository):

$ git submodule add modules/nginx git://

If you're on Debian you will need to install puppet-apt as well.

$ git submodule add modules/apt git://

Include nginx to install and bootstrap it on a box:

    node /^app\d+\.example\.com/ {
      include nginx

      # Setup the default vhost, with supplied template.
      nginx::resource::vhost { 'default':
        ensure  => present,
        content => template('app/vhost.erb'),
      # Setup the upstream proxies referenced by the default vhost (pretend with
      # me here).
      nginx::resource::upstream { 'default':
        ensure => present,
        members =>

The only resources provided by this module are those used above. Find them in manifests/resources/. Explore this module for more details. If you find a place that might be better documented, it should and do take out an issue ticket.

Something went wrong with that request. Please try again.