summaryrefslogtreecommitdiff
path: root/roles/nginx/vhost/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/nginx/vhost/templates')
-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 %}
}