nginx configure template

This commit is contained in:
jysperm
2014-07-05 21:14:13 +08:00
parent 7b38b46535
commit c08702fc04
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
server {
listen <%= site.listen %>;
server_name <%= site.server_name.join(' ') %>;
index <%= site.index.join(' ') %>;
autoindex <%= site.auto_index ? 'on' : 'off' %>;
root <%= site.root %>;
<? if($v["general"]["autoindex"]):?>
autoindex on;
<? endif;?>
<% _.each(site.location, function(rules, path) {
location <%= path %> {
<% _.each(rules, function(param, command) { %>
<% if(_.isArray(param)) { %>
<%= command %> <%= param.join(' ') %>;
<% } else { %>
<%= command %> <%= param %>;
<% } %>
<% }); %>
}
<% }); %>
}

View File

@@ -0,0 +1,3 @@
<% _.each(sites, function(site) { %>
<%= site %>
<% }) %>