Skip to content

Allow per-domain additional Traefik router configuration (merge-based) #4415

Description

@kadirgun

What problem will this feature address?

When adding a custom domain to a Dokploy application, the generated Traefik configuration does not support storing and persisting per-domain advanced router configurations.

Currently:

Use Case

Users with advanced Traefik needs want to:

  1. Configure TLS passthrough per domain
  2. Add custom authentication rules to specific routes
  3. Set custom TLS options (e.g., mutual TLS, pinned certificates)
  4. Persist these settings through domain updates without manual re-configuration

Current Limitations

  • Domain schema stores only middleware names, not full router configuration
  • manageDomain() function always regenerates full config with no merge capability
  • Advanced router properties (TLS, authentication) have no storage mechanism
  • Updates to domain settings trigger full config regeneration, losing custom settings

Related Issues

Describe the solution you'd like

Proposed Solution

  1. Add storage for custom router config per domain
  2. Add UI for advanced Traefik configuration (textarea/YAML editor in domain settings)
  3. Implement merge logic to combine auto-generated config with user-provided custom config
  4. Preserve custom config during domain updates

Benefits

  • Advanced Traefik users gain full flexibility
  • Custom configurations persist through domain updates
  • Backward compatible with existing domains
  • Aligns with existing middleware customization feature

Impact

  • Users can configure TLS passthrough, authentication, and other router-level properties per domain
  • No loss of configuration on domain updates
  • Enable more complex Traefik routing scenarios without manual file editing

Describe alternatives you've considered

Additional context

No response

Will you send a PR to implement it?

Maybe, need help

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions