Added domain specific logs

pull/12/head
Jonathan 2018-03-12 10:07:07 +01:00
parent 6ff1b0eb71
commit da31f0dc0d
3 changed files with 22 additions and 1 deletions

View File

@ -65,6 +65,7 @@
pid: '/run/nginx.pid',
access_log: '/var/log/nginx/access.log',
error_log: '/var/log/nginx/error.log',
domain_log: '$base/log',
client_max_body_size: 16,
gzip: true,
server_tokens: false,
@ -438,6 +439,18 @@
},
},
};
})
.filter('rtrim', function () {
return function (input, character) {
if (character === undefined) {
character = ' ';
}
if (character === "]") character = "\\]";
if (character === "\\") character = "\\\\";
return input.replace(new RegExp(
"[" + character + "]+$", "g"
), "");
}
});
})();

View File

@ -314,6 +314,10 @@
<label class="form-label"><code tooltips tooltip-template="Configures logging path (with warn level).">error_log</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.error_log">
</div>
<div class="form-group">
<label class="form-label"><code tooltips tooltip-template="Configures logging path for the current domain.">Domain specific log path</code></label>
<input type="text" class="form-control form-control-sm" ng-model="data.domain_log" placeholder="$base/log">
</div>
<div class="form-group">
<label class="form-label"><code tooltips tooltip-template="Sets the maximum allowed size of the client request body.">client_max_body_size</code></label>
<div class="input-group">

View File

@ -21,7 +21,11 @@ server {<!--
✘ PHP --><span ng-if="!isPHP()">
root /var/www/{{ domain() }}{{ data.document_root }};</span>
index {{ data.index ? data.index : 'index.html' + (isPHP() ? ' index.php' : '') }};<!--
index {{ data.index ? data.index : 'index.html' + (isPHP() ? ' index.php' : '') }};
access_log {{ data.domain_log | rtrim:'/' }}/access_log;
error_log {{ data.domain_log | rtrim:'/' }}/error_log;<!--
✔ HTTPS --><span ng-if="isHTTPS()">