https://github.com/pmsipilot/nginx-config-cookbook
Configures nginx as a reverse proxy
https://github.com/pmsipilot/nginx-config-cookbook
Last synced: 3 months ago
JSON representation
Configures nginx as a reverse proxy
- Host: GitHub
- URL: https://github.com/pmsipilot/nginx-config-cookbook
- Owner: pmsipilot
- Created: 2014-12-08T09:42:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-15T19:51:54.000Z (about 10 years ago)
- Last Synced: 2025-01-14T02:12:44.973Z (5 months ago)
- Language: Ruby
- Size: 238 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# nginx-config-cookbook [](https://travis-ci.org/pmsipilot/nginx-config-cookbook)
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](#upstreams) with names as key |
| `locations` | Array | `[]` | A list of [locations](#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](#upstreams) |
| `params` | Hash | `{}` | A list of extra parameters for location context |## Usage
### nginx-config::default
Include `nginx-config` in your node's `run_list`:
```json
{
"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):```json
{
"run_list": [
"recipe[nginx-config]",
"recipe[nginx-config::clean]"
]
}
```