From 73d6abd15f27d66df0f73bd2afad8ba24803c1b4 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 28 Dec 2020 22:53:32 +0200 Subject: [PATCH] roles/nginx: Allow sites to override the root --- roles/nginx/templates/vhost.conf.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/nginx/templates/vhost.conf.j2 b/roles/nginx/templates/vhost.conf.j2 index a8b208b..f8b0ee2 100644 --- a/roles/nginx/templates/vhost.conf.j2 +++ b/roles/nginx/templates/vhost.conf.j2 @@ -26,7 +26,12 @@ server { listen 443 ssl http2; listen [::]:443 ssl http2; + {# Allow sites to override the nginx document root #} + {% if item.document_root is defined %} + root {{ item.document_root }}; + {% else %} root {{ nginx_root_prefix }}/{{ domain_name }}; + {% endif %} {# will only work if the TLS cert covers the domain + aliases, like example.com and www.example.com #} server_name {{ domain_name }} {{ domain_aliases }};