From f89a6acda329a3b54f1aa807d1f4ee67b2762c1c Mon Sep 17 00:00:00 2001 From: Marc Seiler Date: Tue, 3 Apr 2018 17:50:17 -0400 Subject: [PATCH] added VIRTUAL_INDEX to allow for specifying an index for the location to use --- nginx.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nginx.tmpl b/nginx.tmpl index 39e38f7..c4d2eae 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -157,6 +157,9 @@ upstream {{ $upstream_name }} { {{/* Get the VIRTUAL_PROTO defined by containers w/ the same vhost, falling back to "http" */}} {{ $proto := trim (or (first (groupByKeys $containers "Env.VIRTUAL_PROTO")) "http") }} +{{/* Get the VIRTUAL_INDEX defined by containers w/ the same vhost, falling back to "" */}} +{{ $index := trim (or (first (groupByKeys $containers "Env.VIRTUAL_INDEX")) "") }} + {{/* Get the NETWORK_ACCESS defined by containers w/ the same vhost, falling back to "external" */}} {{ $network_tag := or (first (groupByKeys $containers "Env.NETWORK_ACCESS")) "external" }} @@ -273,6 +276,10 @@ server { {{ end }} location / { + {{ if ne $index "" }} + index {{ $index }}; + {{ end }} + {{ if eq $proto "uwsgi" }} include uwsgi_params; uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};