Skip to content

Commit b637cd5

Browse files
author
Pierre Buyle
committed
Allow insertion of additional include before and after the main directives block in the http context.
1 parent bf4d917 commit b637cd5

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ The following variables are available to configure the role:
6161
(cf. http://wiki.nginx.org/HttpFlvStreamModule), defaults to false.
6262
- **nginx_drupal_mp4_streaming**: Whether or not to use MP4 streaming, (cf.
6363
http://nginx.org/en/docs/http/ngx_http_mp4_module.html) defaults to false.
64+
- **nginx_drupal_http_pre_includes**: A list of file to include in the ```http```
65+
context (in ```nginx.conf```), before any other directives.
66+
- **nginx_drupal_http_post_includes**: A list of file to include in the ```http```
67+
context (in ```nginx.conf```), after any other directives except the enabled
68+
site configuration files.
6469
- **nginx_drupal_upstream_servers**: The list of PHP upstream servers, each item
6570
is a server address (and parameters, see
6671
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server), defaults

defaults/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ nginx_drupal_flv_streaming: true
2424
nginx_drupal_mp4_streaming: true
2525
nginx_drupal_upstream_servers: ["unix:/var/run/php-fpm.sock", "php-fpm-zwei.sock"]
2626
nginx_drupal_upstream_backup_servers: ["unix:/var/run/php-fpm-bkp.sock"]
27-
nginx_drupal_sites: none
27+
nginx_drupal_sites: none
28+
nginx_drupal_http_pre_includes: []
29+
nginx_drupal_http_post_includes: []

templates/nginx.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ events {
2020
}
2121

2222
http {
23+
{% for include in nginx_drupal_http_pre_includes %}
24+
include {{include}};
25+
{% endfor %}
26+
2327
## MIME types.
2428
include /etc/nginx/mime.types;
2529
default_type application/octet-stream;
@@ -227,6 +231,10 @@ http {
227231
{%- endif -%}
228232
{%- endif -%}
229233

234+
{% for include in nginx_drupal_http_post_includes %}
235+
include {{include}};
236+
{% endfor %}
237+
230238
## Include all vhosts.
231239
include /etc/nginx/sites-enabled/*;
232240
}

0 commit comments

Comments
 (0)