diff --git a/src/nginxconfig/generators/conf/general.conf.js b/src/nginxconfig/generators/conf/general.conf.js index a1f32f2..3053b01 100644 --- a/src/nginxconfig/generators/conf/general.conf.js +++ b/src/nginxconfig/generators/conf/general.conf.js @@ -33,13 +33,13 @@ export default (domains, global) => { config['location = /favicon.ico'] = { log_not_found: 'off', }; - if (global.logging.accessLog.computed) config['location = /favicon.ico'].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config['location = /favicon.ico'].access_log = 'off'; config['# robots.txt'] = ''; config['location = /robots.txt'] = { log_not_found: 'off', }; - if (global.logging.accessLog.computed) config['location = /robots.txt'].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config['location = /robots.txt'].access_log = 'off'; if (global.performance.disableHtmlCaching.computed) { // Disable HTML caching for changes take effect in time @@ -48,7 +48,7 @@ export default (domains, global) => { config[loc] = { add_header: 'Cache-Control "no-cache"', }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } @@ -61,7 +61,7 @@ export default (domains, global) => { config[loc] = { expires: global.performance.assetsExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } } else { // Assets & media separately @@ -71,7 +71,7 @@ export default (domains, global) => { config[loc] = { expires: global.performance.assetsExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } if (global.performance.mediaExpiration.computed) { @@ -80,7 +80,7 @@ export default (domains, global) => { config[loc] = { expires: global.performance.mediaExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } } @@ -93,7 +93,7 @@ export default (domains, global) => { add_header: 'Access-Control-Allow-Origin "*"', expires: global.performance.svgExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } } else { // SVG & fonts separately @@ -104,7 +104,7 @@ export default (domains, global) => { add_header: 'Access-Control-Allow-Origin "*"', expires: global.performance.svgExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } if (global.performance.fontsExpiration.computed) { @@ -114,7 +114,7 @@ export default (domains, global) => { add_header: 'Access-Control-Allow-Origin "*"', expires: global.performance.fontsExpiration.computed, }; - if (global.logging.accessLog.computed) config[loc].access_log = 'off'; + if (global.logging.accessLogEnabled.computed) config[loc].access_log = 'off'; } } } diff --git a/src/nginxconfig/generators/conf/nginx.conf.js b/src/nginxconfig/generators/conf/nginx.conf.js index 5d7f5fa..35953b7 100644 --- a/src/nginxconfig/generators/conf/nginx.conf.js +++ b/src/nginxconfig/generators/conf/nginx.conf.js @@ -107,7 +107,7 @@ export default (domains, global) => { } config.http.push(['# Logging', '']); - if (global.logging.accessLog.computed) { + if (global.logging.accessLogEnabled.computed) { config.http.push(['access_log', global.logging.accessLogPath.computed.trim() + (global.logging.cloudflare.computed ? ' cloudflare' : '') + (global.logging.accessLogParameters.computed ? ` ${global.logging.accessLogParameters.computed.trim()}` : ''), @@ -115,7 +115,7 @@ export default (domains, global) => { } else { config.http.push(['access_log', 'off']); } - if (global.logging.errorLog.computed) { + if (global.logging.errorLogEnabled.computed) { config.http.push(['error_log', global.logging.errorLogPath.computed.trim() + ` ${global.logging.errorLogLevel.computed}`]); } else { diff --git a/src/nginxconfig/generators/conf/website.conf.js b/src/nginxconfig/generators/conf/website.conf.js index 16c9e00..607e564 100644 --- a/src/nginxconfig/generators/conf/website.conf.js +++ b/src/nginxconfig/generators/conf/website.conf.js @@ -221,13 +221,13 @@ export default (domain, domains, global, ipPortPairs) => { } // Access log or error log for domain - if (domain.logging.accessLog.computed || domain.logging.errorLog.computed) { + if (domain.logging.accessLogEnabled.computed || domain.logging.errorLogEnabled.computed) { serverConfig.push(['# logging', '']); - if (domain.logging.accessLog.computed) + if (domain.logging.accessLogEnabled.computed) serverConfig.push(['access_log', getDomainAccessLog(domain, global)]); - if (domain.logging.errorLog.computed) + if (domain.logging.errorLogEnabled.computed) serverConfig.push(['error_log', getDomainErrorLog(domain)]); } diff --git a/src/nginxconfig/templates/domain_sections/logging.vue b/src/nginxconfig/templates/domain_sections/logging.vue index faf411c..fa58823 100644 --- a/src/nginxconfig/templates/domain_sections/logging.vue +++ b/src/nginxconfig/templates/domain_sections/logging.vue @@ -32,14 +32,14 @@ THE SOFTWARE.