File tree 1 file changed +5
-5
lines changed 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ upstream {{ $subdir }} {
29
29
{{ define "locations" }}
30
30
{{ range $subdir, $containers := groupByMulti $ "Env.NGINX_PROXY_SUBDIRECTORY" "," }}
31
31
location /{{ $subdir }} {
32
- {{ $c := where $containers "Env.NGINX_PROXY_SUBDIRECTORY_MAP_TO_ROOT" "1 " }}
33
- {{ $l := len $c }}
34
- {{ if eq $l 0 }}
35
- proxy_pass http ://{{ $subdir }};
32
+ {{ $proto := or (first (groupByKeys $containers "Env.VIRTUAL_PROTO")) "http " }}
33
+ {{ $map_to_root := or (first (groupByKeys $containers "Env.NGINX_PROXY_SUBDIRECTORY_MAP_TO_ROOT")) "1" }}
34
+ {{ if eq $map_to_root "1" }}
35
+ proxy_pass {{ $proto }} ://{{ $subdir }}/ ;
36
36
{{ else }}
37
- proxy_pass http ://{{ $subdir }}/ ;
37
+ proxy_pass {{ $proto }} ://{{ $subdir }};
38
38
{{ end }}
39
39
{{ if (exists (printf "/etc/nginx/htpasswd/%s" $subdir)) }}
40
40
auth_basic "Restricted {{ $subdir }}";
You can’t perform that action at this time.
0 commit comments