Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: www redirect

Andras Bacsai59325406309f
diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.ts
index bba258e4f7..2d1c917754 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: {