summaryrefslogtreecommitdiff
path: root/roles/nginx/vhost/templates/static-files-with-acme.conf.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-03 19:29:46 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-03 19:29:46 +0200
commit0cc14f6472bd45e6fbe1bd2a058da3eb58c5c923 (patch)
tree256658a5a9e70e057889495d187e38354960cd81 /roles/nginx/vhost/templates/static-files-with-acme.conf.j2
parentenable recording to glt-dione and glt-helene (diff)
nginx/vhost make static file templatemore generic
Diffstat (limited to 'roles/nginx/vhost/templates/static-files-with-acme.conf.j2')
-rw-r--r--roles/nginx/vhost/templates/static-files-with-acme.conf.j230
1 files changed, 16 insertions, 14 deletions
diff --git a/roles/nginx/vhost/templates/static-files-with-acme.conf.j2 b/roles/nginx/vhost/templates/static-files-with-acme.conf.j2
index 3dec7f27..09f22544 100644
--- a/roles/nginx/vhost/templates/static-files-with-acme.conf.j2
+++ b/roles/nginx/vhost/templates/static-files-with-acme.conf.j2
@@ -21,24 +21,26 @@ server {
ssl_certificate_key /var/lib/acme/live/{{ nginx_vhost.hostnames[0] }}/privkey;
include snippets/hsts.conf;
-{% if 'directives_extra' in nginx_vhost and 'server' in nginx_vhost.directives_extra %}
- {{ nginx_vhost.directives_extra.server | indent(4) }}
+{% if 'extra_directives' in nginx_vhost %}
+ {{ nginx_vhost.extra_directives | indent(4) }}
{% endif %}
- location / {
- root {{ nginx_vhost.root }};
-{% if 'index' in nginx_vhost %}
- index {{ nginx_vhost.index }};
-{% endif %}
-{% if 'autoindex' in nginx_vhost %}
+{% for path, location in nginx_vhost.locations.items() %}
+ location {{ path }} {
+ root {{ location.root }};
+{% if 'index' in location %}
+ index {{ location.index }};
+{% endif %}
+{% if 'autoindex' in location %}
autoindex on;
-{% if 'format' in nginx_vhost.autoindex %}
+{% if 'format' in location.autoindex %}
autoindex_format {{ nginx_vhost.autoindex.format }};
-{% endif %}
-{% endif %}
-{% if 'directives_extra' in nginx_vhost and 'location' in nginx_vhost.directives_extra %}
+{% endif %}
+{% endif %}
+{% if 'extra_directives' in location %}
- {{ nginx_vhost.directives_extra.location | indent(8) }}
-{% endif %}
+ {{ location.extra_directives | indent(8) }}
+{% endif %}
}
+{% endfor %}
}