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 }};