From 269b34a82102f968be9b4690fff11a7e696ef04a Mon Sep 17 00:00:00 2001 From: Kobi Meirson Date: Sat, 5 Nov 2022 16:49:20 +0200 Subject: [PATCH] fix(cr): migrate previous `access_log` and `error_log` paths using the previous behavior --- src/nginxconfig/util/vue_backwards_compatibility.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nginxconfig/util/vue_backwards_compatibility.js b/src/nginxconfig/util/vue_backwards_compatibility.js index 5d43a67..a14542c 100644 --- a/src/nginxconfig/util/vue_backwards_compatibility.js +++ b/src/nginxconfig/util/vue_backwards_compatibility.js @@ -66,7 +66,7 @@ const migrateLogging = data => { const perDomainAccessLogEnabled = !!perDomainLogging.accessLog; if (perDomainAccessLogEnabled) { accessLogEnabled = true; - accessLogPath = `/var/log/nginx/${perDomainServer.domain}.access.log`; + accessLogPath = accessLogPath.replace(/([^/]+)\.log$/, `${perDomainServer.domain}.$1.log`); } // error_log @@ -77,7 +77,7 @@ const migrateLogging = data => { const perDomainErrorLogEnabled = !!perDomainLogging.errorLog; if (perDomainErrorLogEnabled) { errorLogEnabled = true; - errorLogPath = `/var/log/nginx/${perDomainServer.domain}.error.log`; + errorLogPath = errorLogPath.replace(/([^/]+)\.log$/, `${perDomainServer.domain}.$1.log`); } data.domains[key].logging = {