pull/14/head
Emilien Mantel 2016-01-12 15:10:43 +01:00
parent 2f6f2d4362
commit ef5a7bf756
4 changed files with 9 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Features:
- Proxy + Upstream
- Fast PHP configuration
- Preconfigured vhost templates (should work on many app)
- Auto-configure HTTP2 on SSL/TLS vhosts
Requirements
------------
@ -32,6 +33,7 @@ Role Variables
- `nginx_log_dir`: log directory (if you change it, don't forget to change logrotate config)
- `nginx_resolver`: list of DNS resolver (default: OpenDNS)
- `nginx_error_log_level`: default log level
- `nginx_auto_config_httpv2`: boolean, auto configure HTTP2 where possible
### Nginx Configuration

View File

@ -13,6 +13,7 @@ nginx_resolver_hosts: ['8.8.8.8', '8.8.4.4']
nginx_resolver_valid: '300s'
nginx_resolver_timeout: '5s'
nginx_error_log_level: 'warn' # http://nginx.org/en/docs/ngx_core_module.html#error_log
nginx_auto_config_httpv2: true
#
# Nginx directories

View File

@ -5,6 +5,11 @@
register: nginx_version
changed_when: false
- name: SHELL | Get module list
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed -r 's/_module\s*$//g' |sort
register: nginx_modules
changed_when: false
- name: FILE | Create folders
file: dest={{ item }} owner=root mode=0755 state=directory
with_items: "{{ nginx_dirs }}"

View File

@ -30,7 +30,7 @@ server {
{% endif %}
{% if 'https' in __proto %}
{% for port in __listen_ssl %}
listen {{ port }} ssl;
listen {{ port }} ssl{% if nginx_auto_config_httpv2 and 'http_v2' in nginx_modules.stdout_lines %}http2{% endif %};
{% endfor %}
{{ ssl(item.ssl_name) }}
include {{ nginx_helper_dir + '/ssl-' + item.ssl_template | default('strong') }};