From 9da1673293659a124689aa3934d31bd55bd00ae0 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Wed, 9 Sep 2015 17:44:53 +0200 Subject: [PATCH] Add "more" info on vhost --- README.md | 5 +++-- templates/etc/nginx/sites-available/_base.j2 | 6 ++++++ tests/test.yml | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b2c24c2..8577c1d 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,9 @@ Socket: - `template`: (M) template used to create vhost - `enable`: (O) Enable the vhost (default is true) - `delete`: (O) Delete the vhost (default is false) - - `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www. - - `location`: Add new custom locations (it does not overwrite!) + - `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www + - `location`: (O) Add new custom locations (it does not overwrite!) + - `more`: (O) Add more custom infos. (O) : Optional (M) : Mandatory diff --git a/templates/etc/nginx/sites-available/_base.j2 b/templates/etc/nginx/sites-available/_base.j2 index 82c613b..331a5b5 100644 --- a/templates/etc/nginx/sites-available/_base.j2 +++ b/templates/etc/nginx/sites-available/_base.j2 @@ -22,6 +22,12 @@ server { index {{ item.index | default('index.html index.htm') }}; {% endblock %} +{% if item.more is defined and item.more is iterable %} +{% for line in item.more %} + {{ item.more }} +{% endfor %} +{% endif %} + location / { {% block template_try_files %} try_files $uri $uri/ =404; diff --git a/tests/test.yml b/tests/test.yml index 151b1aa..8fb9791 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -14,6 +14,8 @@ - 'test-alias.local' - 'test2-alias.local' template: '_base' + more: + - 'etag off;' location: '/test': - 'return 403;'