2016-01-12 18:14:36 +07:00
|
|
|
Upstream management
|
|
|
|
===================
|
|
|
|
|
|
|
|
`nginx_upstreams`: List of dict. An upstream has few keys. See bellow.
|
|
|
|
|
|
|
|
Note: Few params are unavailable on old Nginx version. But this role do _not_ put it if your version is too old!
|
|
|
|
|
|
|
|
Upstream params
|
|
|
|
---------------
|
|
|
|
|
2017-04-25 17:27:08 +07:00
|
|
|
- `name`: upstream name. Can be use in site with *proxy_pass http://upstream_name*
|
2016-01-12 18:14:36 +07:00
|
|
|
- `params`: list of param (hash, zone...)
|
|
|
|
- `servers`: each upstream MUST have at least 1 server
|
2016-05-11 22:21:52 +07:00
|
|
|
- `state`: Optional. Can be 'absent' or 'present'
|
2016-01-12 18:14:36 +07:00
|
|
|
|
|
|
|
Server params
|
|
|
|
-------------
|
|
|
|
|
|
|
|
You must set a `path`. For example: *192.168.0.50:8080* or *unix:/tmp/my.sock*.
|
|
|
|
|
|
|
|
All this params are optional. You should see [Nginx upstream doc](http://nginx.org/en/docs/http/ngx_http_upstream_module.html).
|
|
|
|
|
|
|
|
- `weight`
|
|
|
|
- `max_fails`
|
|
|
|
- `fail_timeout`
|
|
|
|
- `backup`
|
|
|
|
- `down`
|
|
|
|
- `route`
|
2016-03-05 18:12:09 +07:00
|
|
|
- `slow_start`
|
2016-01-12 18:14:36 +07:00
|
|
|
|
2016-03-15 01:27:51 +07:00
|
|
|
Example
|
|
|
|
-------
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
nginx_upstreams:
|
|
|
|
- name: 'proxy_apache'
|
|
|
|
servers:
|
|
|
|
- path: '127.0.0.1:80'
|
|
|
|
max_conns: 150
|
|
|
|
weight: 10
|
|
|
|
down: false
|
2016-05-11 22:21:52 +07:00
|
|
|
state: 'present'
|
2016-03-15 01:27:51 +07:00
|
|
|
```
|