From 59325406309f21546fa9f036eb41f23bb0d47a67 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 19 Jan 2023 14:33:20 +0100 Subject: [PATCH] fix: www redirect --- apps/api/src/routes/webhooks/traefik/handlers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts index bba258e4f..2d1c91775 100644 --- a/apps/api/src/routes/webhooks/traefik/handlers.ts +++ b/apps/api/src/routes/webhooks/traefik/handlers.ts @@ -50,6 +50,9 @@ function generateRouters( isHttp2 = false ) { let rule = `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`; + let ruleWWW = `Host(\`www.${nakedDomain}\`)${ + pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : '' + }`; let http: any = { entrypoints: ['web'], rule, @@ -69,14 +72,14 @@ function generateRouters( }; let httpWWW: any = { entrypoints: ['web'], - rule, + rule: ruleWWW, service: `${serviceId}`, priority: 2, middlewares: [] }; let httpsWWW: any = { entrypoints: ['websecure'], - rule, + rule: ruleWWW, service: `${serviceId}`, priority: 2, tls: {