diff --git a/nginx.tmpl b/nginx.tmpl index ebf0f33..fd5d2e9 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -68,9 +68,6 @@ upstream {{ $host }} { {{ end }} } -{{/* Get the htpasswd file defined by containers w/ the same vhost */}} -{{ $htpasswdFile := (first (groupByKeys $containers "Env.HTPASSWD_FILE”)) }} - {{/* Get the first cert name defined by containers w/ the same vhost */}} {{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }} @@ -109,9 +106,9 @@ server { location / { proxy_pass http://{{ $host }}; - {{ if (exists (printf "/etc/nginx/htpasswd/$s" $host)) }} + {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }} auth_basic "Restricted {{ $host }}"; - auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/$s" $host }}; + auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }}; {{ end }} } } @@ -122,9 +119,9 @@ server { location / { proxy_pass http://{{ $host }}; - {{ if (exists (printf "/etc/nginx/htpasswd/$s" $host)) }} + {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }} auth_basic "Restricted {{ $host }}"; - auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/$s" $host }}; + auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }}; {{ end }} } }