From 709e52eb0b9db6339e378c9657a241a35c339fed Mon Sep 17 00:00:00 2001 From: Alexander Rublev Date: Wed, 14 Nov 2018 23:33:54 +0700 Subject: [PATCH] Allow to generate custom locations in web_server mode --- templates/http/default.conf.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index 9634427..a7fe9f9 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -39,10 +39,12 @@ server { {% endfor %} {% endif %} {% if item.value.web_server is defined %} - location / { - root {{ item.value.web_server.html_file_location }}; - index {{ item.value.web_server.html_file_name }}; +{% for location in item.value.web_server.locations %} + location {{ item.value.web_server.locations[location].location }} { + root {{ item.value.web_server.locations[location].html_file_location }}; + index {{ item.value.web_server.locations[location].html_file_name }}; } +{% endfor %} {% if item.value.web_server.http_demo_conf %} sub_filter_once off; sub_filter 'server_hostname' '$hostname';