1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-02 06:45:45 +00:00

Add support for adding options to the location block of a vhost

This commit is contained in:
Richard Bateman
2015-08-14 11:36:39 -06:00
parent b131b00e19
commit d9ee7ed704
2 changed files with 31 additions and 0 deletions

View File

@ -135,6 +135,11 @@ server {
auth_basic "Restricted {{ $host }}";
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
{{ end }}
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
include {{ printf "/etc/nginx/vhost.d/%s_location"}}
{{ else if (exists /etc/vhost.d/defaults_location) }}
include /etc/nginx/vhost.d/defaults_location
{{ end }}
}
}
{{ else }}
@ -155,6 +160,11 @@ server {
auth_basic "Restricted {{ $host }}";
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
{{ end }}
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
include {{ printf "/etc/nginx/vhost.d/%s_location"}}
{{ else if (exists /etc/vhost.d/defaults_location) }}
include /etc/nginx/vhost.d/defaults_location
{{ end }}
}
}