Skip to content

pmsipilot/nginx-config-cookbook

Repository files navigation

nginx-config-cookbook Build Status

Configures nginx

Supported Platforms

  • CentOS 6.5

Attributes

Key Type Default Description
servers Hash {} A list of servers with names as key

Servers

Key Type Default Description
port Integer 80 The port to listen on
root String nil The server's document root
enable Boolean true Enable or disable the server
upstreams Hash {} A list of upstreams with names as key
locations Array [] A list of locations definitions
params Hash {} A list of extra parameters for server context

Upstreams

Key Type Default Description
ip String nil The IP of the upstream server
port Integer 80 The port of the upstream server

Locations

Key Type Default Description
path String nil The location path
alias String nil The location alias
upstream String nil Name of an existing upstream
params Hash {} A list of extra parameters for location context

Usage

nginx-config::default

Include nginx-config in your node's run_list:

{
  "run_list": [
    "recipe[nginx-config]"
  ]
}

nginx-config::clean

This recipe will let you disable server configurations. Every server marked with enable => false will be disabled (i.e. configuration file or symlink deleted):

{
  "run_list": [
    "recipe[nginx-config]",
    "recipe[nginx-config::clean]"
  ]
}