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

This commit is contained in:
Richard Bateman committed 2015-08-14 12:26:19 -06:00
1 parent b131b00e19
commit d9ee7ed704
2 files changed
+31

No files matched your search

+10
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 }}
}
}