|
@@ -62,7 +62,7 @@ location {{ .Path }} {
|
|
{{ else if eq .Proto "grpc" }}
|
|
{{ else if eq .Proto "grpc" }}
|
|
grpc_pass {{ trim .Proto }}://{{ trim .Upstream }};
|
|
grpc_pass {{ trim .Proto }}://{{ trim .Upstream }};
|
|
{{ else }}
|
|
{{ else }}
|
|
- proxy_pass {{ trim .Proto }}://{{ trim .Upstream }}/;
|
|
|
|
|
|
+ proxy_pass {{ trim .Proto }}://{{ trim .Upstream }}{{ trim .Dest }};
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
{{ if (exists (printf "/etc/nginx/htpasswd/%s" .Host)) }}
|
|
{{ if (exists (printf "/etc/nginx/htpasswd/%s" .Host)) }}
|
|
@@ -386,12 +386,13 @@ server {
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
{{ if eq $nPaths 0 }}
|
|
{{ if eq $nPaths 0 }}
|
|
- {{ template "location" (dict "Path" "/" "Proto" $proto "Upstream" $upstream_name "Host" $host "Vhostroot" $vhost_root) }}
|
|
|
|
|
|
+ {{ template "location" (dict "Path" "/" "Proto" $proto "Upstream" $upstream_name "Host" $host "Vhostroot" $vhost_root "Dest" "") }}
|
|
{{ else }}
|
|
{{ else }}
|
|
{{ range $path, $container := $paths }}
|
|
{{ range $path, $container := $paths }}
|
|
{{ $sum := sha1 $path }}
|
|
{{ $sum := sha1 $path }}
|
|
{{ $upstream := printf "%s-%s" $upstream_name $sum }}
|
|
{{ $upstream := printf "%s-%s" $upstream_name $sum }}
|
|
- {{ template "location" (dict "Path" $path "Proto" $proto "Upstream" $upstream "Host" $host "Vhostroot" $vhost_root) }}
|
|
|
|
|
|
+ {{ $dest := (or (first (groupByKeys $container "Env.VIRTUAL_DEST")) "") }}
|
|
|
|
+ {{ template "location" (dict "Path" $path "Proto" $proto "Upstream" $upstream "Host" $host "Vhostroot" $vhost_root "Dest" $dest) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if (not (contains $paths "/")) }}
|
|
{{ if (not (contains $paths "/")) }}
|
|
location / {
|
|
location / {
|
|
@@ -428,12 +429,13 @@ server {
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
{{ if eq $nPaths 0 }}
|
|
{{ if eq $nPaths 0 }}
|
|
- {{ template "location" (dict "Path" "/" "Proto" $proto "Upstream" $upstream_name "Host" $host "Vhostroot" $vhost_root) }}
|
|
|
|
|
|
+ {{ template "location" (dict "Path" "/" "Proto" $proto "Upstream" $upstream_name "Host" $host "Vhostroot" $vhost_root "Dest" "") }}
|
|
{{ else }}
|
|
{{ else }}
|
|
{{ range $path, $container := $paths }}
|
|
{{ range $path, $container := $paths }}
|
|
{{ $sum := sha1 $path }}
|
|
{{ $sum := sha1 $path }}
|
|
{{ $upstream := printf "%s-%s" $upstream_name $sum }}
|
|
{{ $upstream := printf "%s-%s" $upstream_name $sum }}
|
|
- {{ template "location" (dict "Path" $path "Proto" $proto "Upstream" $upstream "Host" $host "Vhostroot" $vhost_root) }}
|
|
|
|
|
|
+ {{ $dest := (or (first (groupByKeys $container "Env.VIRTUAL_DEST")) "") }}
|
|
|
|
+ {{ template "location" (dict "Path" $path "Proto" $proto "Upstream" $upstream "Host" $host "Vhostroot" $vhost_root "Dest" $dest) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if (not (contains $paths "/")) }}
|
|
{{ if (not (contains $paths "/")) }}
|
|
location / {
|
|
location / {
|