diff --git a/apps/dokploy/server/api/routers/settings.ts b/apps/dokploy/server/api/routers/settings.ts index 5610e8d96..00584bf2d 100644 --- a/apps/dokploy/server/api/routers/settings.ts +++ b/apps/dokploy/server/api/routers/settings.ts @@ -225,9 +225,7 @@ export const settingsRouter = createTRPCRouter({ } const user = await updateUser(ctx.user.ownerId, { host: input.host, - ...(input.letsEncryptEmail && { - letsEncryptEmail: input.letsEncryptEmail, - }), + letsEncryptEmail: input.letsEncryptEmail, certificateType: input.certificateType, https: input.https, }); diff --git a/packages/server/src/utils/traefik/web-server.ts b/packages/server/src/utils/traefik/web-server.ts index 02472a583..0209d9a21 100644 --- a/packages/server/src/utils/traefik/web-server.ts +++ b/packages/server/src/utils/traefik/web-server.ts @@ -23,11 +23,18 @@ export const updateServerTraefik = ( config.http.routers = config.http.routers || {}; config.http.services = config.http.services || {}; + // Get or create router config, but always update the rule with newHost const currentRouterConfig = config.http.routers[`${appName}-router-app`] || { - rule: `Host(\`${newHost}\`)`, service: `${appName}-service-app`, entryPoints: ["web"], + rule: `Host(\`${newHost}\`)`, }; + + // Always update the rule with the new host + if (newHost) { + currentRouterConfig.rule = `Host(\`${newHost}\`)`; + } + config.http.routers[`${appName}-router-app`] = currentRouterConfig; config.http.services = {