Closes #9
parent
2f6f2d4362
commit
ef5a7bf756
|
@ -12,6 +12,7 @@ Features:
|
||||||
- Proxy + Upstream
|
- Proxy + Upstream
|
||||||
- Fast PHP configuration
|
- Fast PHP configuration
|
||||||
- Preconfigured vhost templates (should work on many app)
|
- Preconfigured vhost templates (should work on many app)
|
||||||
|
- Auto-configure HTTP2 on SSL/TLS vhosts
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
@ -32,6 +33,7 @@ Role Variables
|
||||||
- `nginx_log_dir`: log directory (if you change it, don't forget to change logrotate config)
|
- `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_resolver`: list of DNS resolver (default: OpenDNS)
|
||||||
- `nginx_error_log_level`: default log level
|
- `nginx_error_log_level`: default log level
|
||||||
|
- `nginx_auto_config_httpv2`: boolean, auto configure HTTP2 where possible
|
||||||
|
|
||||||
### Nginx Configuration
|
### Nginx Configuration
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ nginx_resolver_hosts: ['8.8.8.8', '8.8.4.4']
|
||||||
nginx_resolver_valid: '300s'
|
nginx_resolver_valid: '300s'
|
||||||
nginx_resolver_timeout: '5s'
|
nginx_resolver_timeout: '5s'
|
||||||
nginx_error_log_level: 'warn' # http://nginx.org/en/docs/ngx_core_module.html#error_log
|
nginx_error_log_level: 'warn' # http://nginx.org/en/docs/ngx_core_module.html#error_log
|
||||||
|
nginx_auto_config_httpv2: true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Nginx directories
|
# Nginx directories
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
register: nginx_version
|
register: nginx_version
|
||||||
changed_when: false
|
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
|
- name: FILE | Create folders
|
||||||
file: dest={{ item }} owner=root mode=0755 state=directory
|
file: dest={{ item }} owner=root mode=0755 state=directory
|
||||||
with_items: "{{ nginx_dirs }}"
|
with_items: "{{ nginx_dirs }}"
|
||||||
|
|
|
@ -30,7 +30,7 @@ server {
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if 'https' in __proto %}
|
{% if 'https' in __proto %}
|
||||||
{% for port in __listen_ssl %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{{ ssl(item.ssl_name) }}
|
{{ ssl(item.ssl_name) }}
|
||||||
include {{ nginx_helper_dir + '/ssl-' + item.ssl_template | default('strong') }};
|
include {{ nginx_helper_dir + '/ssl-' + item.ssl_template | default('strong') }};
|
||||||
|
|
Loading…
Reference in New Issue