Fix jessie and add doc

pull/6/head 1.0.3
Emilien Mantel 2015-10-09 17:54:07 +02:00
parent 63fee94d90
commit eaf4032bc0
4 changed files with 51 additions and 10 deletions

View File

@ -47,9 +47,11 @@ Socket:
### Vhost management ### Vhost management
You can see many examples in: [tests/test.yml](tests/test.yml).
- `nginx_vhosts`: List of dict. A vhost has few keys. See bellow. - `nginx_vhosts`: List of dict. A vhost has few keys. See bellow.
#### #### Common
- `name`: (M) List of domain used. The first occurence is the most important! - `name`: (M) List of domain used. The first occurence is the most important!
- `template`: (M) template used to create vhost - `template`: (M) template used to create vhost
@ -69,10 +71,48 @@ Socket:
- `php`: PHP base template. Can work with many frameworks/tools. - `php`: PHP base template. Can work with many frameworks/tools.
- `wordpress` - `wordpress`
- `dokuwiki` - `dokuwiki`
- `proxy`
Templates works as parent-child. Templates works as parent-child.
You can see many examples in: [tests/test.yml](tests/test.yml). #### About proxy template
Proxy template allow you to use Nginx as reverse proxy. Usefull when you have application serveur such as Redmine, Jenkins...
You have many key added to vhost key:
- `upstream_name`: (O) upstream name used to pass proxy
- `proxy_params`: (M) list of raw params passed to the vhost
(O) : Optional
(M) : Mandatory
### 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 don't put it if your version is too old!
#### Upstream params
- `name`: upstream name. Can be use in vhost with *proxy_pass http://upstream_name*
- `params`: list of param (hash, zone...)
- `servers`: each upstream MUST have at least 1 server
#### 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`
- `slow`start`
Dependencies Dependencies
------------ ------------

View File

@ -9,7 +9,7 @@
upstream {{ item.name }} { upstream {{ item.name }} {
{% for server in item.servers %} {% for server in item.servers %}
server {{ server.name }}{% for p in nginx_upstream_server_params if server[p.key] is defined %}{{ s(p.key, server[p.key] | default(p.default), p.is_bool | default(false), p.min_version | default('0.0.1')) }}{% endfor %}; server {{ server.path }}{% for p in nginx_upstream_server_params if server[p.key] is defined %}{{ s(p.key, server[p.key] | default(p.default), p.is_bool | default(false), p.min_version | default('0.0.1')) }}{% endfor %};
{% endfor %} {% endfor %}
{% if item.params is defined and item.params is iterable %} {% if item.params is defined and item.params is iterable %}
{% for param in item.params %} {% for param in item.params %}

View File

@ -11,7 +11,7 @@
nginx_upstreams: nginx_upstreams:
- name: 'test' - name: 'test'
servers: servers:
- name: '127.0.0.1:80' - path: '127.0.0.1:80'
max_conns: 150 max_conns: 150
weight: 10 weight: 10
down: false down: false

View File

@ -16,9 +16,10 @@ nginx_upstream_server_params:
default: 'configuration_error' default: 'configuration_error'
- key: 'slow_start' - key: 'slow_start'
default: 0 default: 0
- key: 'max_conns' # Nginx Plus only
default: 0 # - key: 'max_conns'
min_version: '1.5.9' # default: 0
- key: 'resolve' # min_version: '1.5.9'
is_bool: true # - key: 'resolve'
min_version: '1.5.12' # is_bool: true
# min_version: '1.5.12'