diff --git a/defaults/main/template.yml b/defaults/main/template.yml index 868d6e2..8d75b67 100644 --- a/defaults/main/template.yml +++ b/defaults/main/template.yml @@ -49,6 +49,7 @@ nginx_main_template: types: "text/html" # custom_options: [] # http_custom_options: [] + # http_custom_includes: [] # events_custom_options: [] stream_enable: false # stream_custom_options: [] diff --git a/molecule/common/playbook_template.yml b/molecule/common/playbook_template.yml index 5c5000b..2dc667c 100644 --- a/molecule/common/playbook_template.yml +++ b/molecule/common/playbook_template.yml @@ -44,6 +44,8 @@ - master_process on; http_custom_options: - aio off; + http_custom_includes: + - "/etc/nginx/sites-enabled/*.conf" events_custom_options: - accept_mutex off; stream_enable: true diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 3a14d34..e2b2536 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -119,6 +119,11 @@ http { {% endfor %} {% endif %} include /etc/nginx/conf.d/*.conf; +{% if nginx_main_template.http_custom_includes is defined and nginx_main_template.http_custom_includes | length %} +{% for inline_include in nginx_main_template.http_custom_includes %} + include {{ inline_include }}; +{% endfor %} +{% endif %} } {% endif %}