|
@@ -106,6 +106,10 @@ server {
|
|
|
|
|
|
location / {
|
|
|
proxy_pass http://{{ $host }};
|
|
|
+ {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
|
|
+ auth_basic "Restricted {{ $host }}";
|
|
|
+ auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
|
|
+ {{ end }}
|
|
|
}
|
|
|
}
|
|
|
{{ else }}
|
|
@@ -115,6 +119,10 @@ server {
|
|
|
|
|
|
location / {
|
|
|
proxy_pass http://{{ $host }};
|
|
|
+ {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
|
|
+ auth_basic "Restricted {{ $host }}";
|
|
|
+ auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
|
|
+ {{ end }}
|
|
|
}
|
|
|
}
|
|
|
|