This commit is contained in:
jysperm
2014-07-19 02:30:42 +08:00
parent 5064eaf0fc
commit 6c84647188
3 changed files with 3 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ exports.post '/update_site/', (req, res) ->
, callback
addSite = (callback) ->
req.body.config._id = new ObjectID()
mAccount.update _id: req.account._id,
$push:
'attribute.plugin.nginx.sites': req.body.config

View File

@@ -20,7 +20,7 @@ exports.assert = (account, config, site_id, callback) ->
site = _.find result.attribute.plugin.nginx.sites, (i) ->
return domain in i.server_name
if site._id.toString() == site_id.toString()
if site._id.toString() == site_id?.toString()
callback null
else
callback 'unavailable_server_name'

View File

@@ -7,7 +7,7 @@ server {
root <%= site.root %>;
<% _.each(site.location, function(rules, path) {
<% _.each(site.location, function(rules, path) { %>
location <%= path %> {
<% _.each(rules, function(param, command) { %>
<% if(_.isArray(param)) { %>