diff --git a/src/nginxconfig/generators/conf/website.conf.js b/src/nginxconfig/generators/conf/website.conf.js index 607e564..5dbe7d4 100644 --- a/src/nginxconfig/generators/conf/website.conf.js +++ b/src/nginxconfig/generators/conf/website.conf.js @@ -127,6 +127,14 @@ const httpRedirectConfig = (domain, global, ipPortPairs, domainName, redirectDom config.push(...httpListen(domain, global, ipPortPairs)); config.push(['server_name', domainName]); + // Logging + if (domain.logging.redirectAccessLog.computed) { + config.push(['access_log', getDomainAccessLog(domain, global)]); + } + if (domain.logging.redirectErrorLog.computed) { + config.push(['error_log', getDomainErrorLog(domain)]); + } + if (domain.https.certType.computed === 'letsEncrypt') { // Let's encrypt @@ -410,7 +418,15 @@ export default (domain, domains, global, ipPortPairs) => { // HTTPS redirectConfig.push(...sslConfig(domain, global)); - + + // Logging + if (domain.logging.redirectAccessLog.computed) { + redirectConfig.push(['access_log', getDomainAccessLog(domain, global)]); + } + if (domain.logging.redirectErrorLog.computed) { + redirectConfig.push(['error_log', getDomainErrorLog(domain)]); + } + redirectConfig.push(['return', `301 http${domain.https.https.computed ? 's' : ''}://${domain.server.wwwSubdomain.computed ? 'www.' : ''}${domain.server.domain.computed}$request_uri`]); diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/logging.js b/src/nginxconfig/i18n/en/templates/domain_sections/logging.js index 6198558..342d4b9 100644 --- a/src/nginxconfig/i18n/en/templates/domain_sections/logging.js +++ b/src/nginxconfig/i18n/en/templates/domain_sections/logging.js @@ -31,4 +31,5 @@ export default { enableForThisDomain: `${common.enable} for this domain`, arguments: 'arguments', level: 'logging level', + forRedirects: 'for redirects', }; diff --git a/src/nginxconfig/templates/domain_sections/logging.vue b/src/nginxconfig/templates/domain_sections/logging.vue index 272cb7b..1deecb5 100644 --- a/src/nginxconfig/templates/domain_sections/logging.vue +++ b/src/nginxconfig/templates/domain_sections/logging.vue @@ -69,6 +69,23 @@ THE SOFTWARE. +