mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-04-09 12:42:10 +07:00
Renaming variables *vhost* -> *site*
Vhost is an Apache configuration, not Nginx. Manages backward compatibility.
This commit is contained in:
@@ -4,7 +4,7 @@ Auth Basic management
|
||||
Description
|
||||
-----------
|
||||
|
||||
Auth basic is managed in a separate list. Each auth file can be shared between locations or vhosts.
|
||||
Auth basic is managed in a separate list. Each auth file can be shared between locations or sites.
|
||||
|
||||
Each htpasswd has few keys:
|
||||
|
||||
@@ -19,8 +19,8 @@ Example
|
||||
-------
|
||||
|
||||
```yaml
|
||||
nginx_vhosts:
|
||||
# htpasswd on all vhost
|
||||
nginx_sites:
|
||||
# htpasswd on all site
|
||||
- name: test.local
|
||||
htpasswd: 'hello'
|
||||
template: '_base'
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
Vhost management
|
||||
================
|
||||
Site 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_sites`: List of dict. A site has few keys. See bellow.
|
||||
|
||||
Common
|
||||
------
|
||||
|
||||
- `name`: (M) Domain or list of domain used.
|
||||
- `template`: (D) template used to create vhost. Optional if you set `delete` to true or using `redirect_tor`.
|
||||
- `template`: (D) template used to create site. Optional if you set `delete` to true or using `redirect_tor`.
|
||||
- `filename`: (O) Specify filename in /etc/nginx/sites-*. Do NOT specify default (reserved keyword). It will be used for log filenames and directories creation.
|
||||
- `state`: (O) Vhost status. Can be "present" (default), "absent" and "disabled".
|
||||
- `state`: (O) Site status. Can be "present" (default), "absent" and "disabled".
|
||||
- `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www
|
||||
- `redirect_to`: (O) Redirect all requests to this domain. Please set scheme (http:// or https:// or $sheme).
|
||||
- `headers`: (O) Set additionals header as key/value list. You can append "always" to the value. Show [nginx doc](http://nginx.org/en/docs/http/ngx_http_headers_module.html).
|
||||
@@ -23,7 +23,7 @@ Common
|
||||
- `upstream_params`: (O) Add upstream params (useful when you want to pass variables to PHP)
|
||||
- `override_try_files`: (O) overrides default try\_files defined in template
|
||||
- `manage_local_content`: (O) Boolean. Set to false if you do not want to manage local content (images, css...). This option is useless if you use `_proxy` template or `redirect_to` feature.
|
||||
- `htpasswd`: (O) References name key in `nginx_htpasswd`. Enable auth basic on all vhost. Set "false" to disable.
|
||||
- `htpasswd`: (O) References name key in `nginx_htpasswd`. Enable auth basic on all site. Set "false" to disable.
|
||||
- `proto`: (O) list of protocol used. Default is a list with "http". If you need http and https, you must set a list with "http" and "https". You can only set "https" without http support.
|
||||
- `ssl_name`: (D) name of the key used when using TLS/SSL. Optional when `proto` contains "https". If you don't set this value, it will search by `name`.
|
||||
- `ssl_template` (O) "strong" (default) or "legacy". You can disable SSL helpers and add your own directives by setting "false".
|
||||
@@ -57,17 +57,17 @@ About proxy template
|
||||
|
||||
Proxy template allow you to use Nginx as reverse proxy. Usefull when you have an application service such as Redmine, Jenkins...
|
||||
|
||||
You have many key added to vhost key:
|
||||
You have many key added to site key:
|
||||
|
||||
- `upstream_name`: (O) upstream name used to pass proxy
|
||||
- `proxy_params`: (M) list of raw params passed to the vhost
|
||||
- `proxy_params`: (M) list of raw params passed to the site
|
||||
|
||||
(O) : Optional
|
||||
|
||||
Default vhosts
|
||||
Default sites
|
||||
--------------
|
||||
|
||||
You can manage default vhost by setting domain name to these variables.
|
||||
You can manage default site by setting domain name to these variables.
|
||||
|
||||
- `nginx_default_vhost`
|
||||
- `nginx_default_vhost_ssl`
|
||||
- `nginx_default_site`
|
||||
- `nginx_default_site_ssl`
|
||||
@@ -33,7 +33,7 @@ Tips
|
||||
----
|
||||
|
||||
- Deploying key/cert is not mandatory with this role. You can manage it in other place ([letsencrypt](https://letsencrypt.org/)? :)). You just need to set `dest_cert` and `dest_key`!
|
||||
- In `nginx_vhosts`, `ssl_name` is mandatory. This role will search in `nginx_ssl_pairs` with vhost `name` (first in list if it's a list).
|
||||
- In `nginx_sites`, `ssl_name` is mandatory. This role will search in `nginx_ssl_pairs` with site `name` (first in list if it's a list).
|
||||
|
||||
Diffie-Hellman
|
||||
--------------
|
||||
@@ -44,7 +44,7 @@ Example
|
||||
-------
|
||||
|
||||
```yaml
|
||||
nginx_vhosts;
|
||||
nginx_sites;
|
||||
- name: 'test-ssl.local'
|
||||
proto: ['http', 'https']
|
||||
template: '_base'
|
||||
|
||||
@@ -8,7 +8,7 @@ Note: Few params are unavailable on old Nginx version. But this role do _not_ pu
|
||||
Upstream params
|
||||
---------------
|
||||
|
||||
- `name`: upstream name. Can be use in vhost with *proxy_pass http://upstream_name*
|
||||
- `name`: upstream name. Can be use in site with *proxy_pass http://upstream_name*
|
||||
- `params`: list of param (hash, zone...)
|
||||
- `servers`: each upstream MUST have at least 1 server
|
||||
- `state`: Optional. Can be 'absent' or 'present'
|
||||
|
||||
Reference in New Issue
Block a user