fix: Infinite loop on www domains

This commit is contained in:
Andras Bacsai 2022-04-03 17:49:41 +02:00
parent 45af5cbef8
commit b049297082

View File

@ -175,7 +175,7 @@ export async function configureHAProxy() {
isRunning, isRunning,
isHttps, isHttps,
redirectValue, redirectValue,
redirectTo: isWWW ? domain : 'www.' + domain, redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain,
updatedAt: updatedAt.getTime() updatedAt: updatedAt.getTime()
}); });
} }
@ -199,7 +199,7 @@ export async function configureHAProxy() {
isRunning, isRunning,
isHttps, isHttps,
redirectValue, redirectValue,
redirectTo: isWWW ? previewDomain : 'www.' + previewDomain, redirectTo: isWWW ? previewDomain.replace('www.', '') : 'www.' + previewDomain,
updatedAt: updatedAt.getTime() updatedAt: updatedAt.getTime()
}); });
} }
@ -242,7 +242,7 @@ export async function configureHAProxy() {
isRunning, isRunning,
isHttps, isHttps,
redirectValue, redirectValue,
redirectTo: isWWW ? domain : 'www.' + domain, redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain,
updatedAt: updatedAt.getTime() updatedAt: updatedAt.getTime()
}); });
} }
@ -262,7 +262,7 @@ export async function configureHAProxy() {
domain, domain,
isHttps, isHttps,
redirectValue, redirectValue,
redirectTo: isWWW ? domain : 'www.' + domain redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain
}); });
} }
const output = mustache.render(template, data); const output = mustache.render(template, data);