Add "Also add www / non-www variant" toggle to the Add Domain dialog

Abierto
#5,875 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
nextjs, typescript
Área
devops, frontend

Línea de trabajo

Start by locating the Add Domain dialog and its existing domain.create call; the issue does not name file paths or tests. Check how the dialog handles host input and existing domains, then trace which domain settings are passed to creation. Done means the Add dialog can create both host variants with matching settings under the stated conditions, without changing Edit or the API.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
What problem will this feature address?

Each domain entry in Dokploy only matches its exact host. An application that should answer on both example.com and www.example.com needs two domain entries. Whichever one is missing returns a Traefik 404, even when DNS already points to the server, because no router matches that host. Order doesn't matter: adding www.example.com first leaves example.com returning 404, and the reverse is also true.

So each app needs a second, near-identical domain added by hand: the same path, port, HTTPS toggle and certificate provider, with only the www. prefix added or removed. With several apps (we run 7 on one server), this is repetitive and easy to forget. The usual result is a 404 on one variant that someone reports later.

The existing "Redirect to www" / "Redirect to non-www" presets (#333, #3088) don't solve this. They only work once both domain entries exist.

Describe the solution you'd like

Add a toggle under the Host field in the Add Domain dialog:

  • Also add www.example.com (or Also add example.com when the host starts with www.)

When it's enabled, clicking Create saves two ordinary domain entries with the same path, internal path, container port, HTTPS, certificate and middleware settings. Only the host differs:

  • Host example.com also creates www.example.com.
  • Host www.example.com also creates example.com.

Behaviour:

  • Off by default, and shown only in the Add dialog, not Edit.
  • Hidden for wildcard hosts and IP addresses.
  • Disabled, with an "already exists" hint, when the service already has that host.
  • No schema change and no migration. The UI calls the existing domain.create twice, so the API is unchanged.
  • Existing domains are untouched. Nothing is added automatically to services that already exist.

After creation, the two entries are independent, exactly as if they had been added by hand. To pick one main address, users keep using Advanced -> Redirects as they do today.

Possible follow-up, not part of this request: link the two variants in one domain entry (Host(`a`) || Host(`b`)) so edits stay in sync and one certificate covers both.

Describe alternatives you've considered
  • Adding the second domain manually on every app. This is what we do today.
  • Advanced -> Redirects presets. They still need both domains added first.
  • A manual Traefik router in the Traefik File System. That works, but it lives outside the service and gets out of sync when services change.
Additional context

No response

Will you send a PR to implement it?

Yes

Lenguaje dominante
TypeScript
Estrellas
38.8k
Forks
3.2k
Merge medio
1 d 10 h
PR fusionados (30 d)
110

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Dokploy/dokploy

Todos los issues de Dokploy/dokploy

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.