allow one .htpasswd file for all VIRTUAL_HOST’s
This commit is contained in:
parent
e80fc0b304
commit
025e3a11cf
1 changed files with 13 additions and 7 deletions
|
|
@ -287,6 +287,9 @@ server {
|
|||
{{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
||||
{{ else if (exists ("/etc/nginx/htpasswd/.htpasswd")) }}
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
auth_basic_user_file {{ "/etc/nginx/htpasswd/.htpasswd" }};
|
||||
{{ end }}
|
||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
|
||||
include {{ printf "/etc/nginx/vhost.d/%s_location" $host}};
|
||||
|
|
@ -333,6 +336,9 @@ server {
|
|||
{{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
||||
{{ else if (exists ("/etc/nginx/htpasswd/.htpasswd")) }}
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
auth_basic_user_file {{ "/etc/nginx/htpasswd/.htpasswd" }};
|
||||
{{ end }}
|
||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
|
||||
include {{ printf "/etc/nginx/vhost.d/%s_location" $host}};
|
||||
|
|
|
|||
Loading…
Reference in a new issue