wtree Cloud

Domains and routing

Route a hostname to an application or Compose service, with HTTPS, path rewriting and custom Traefik entrypoints.

Add a domain to an application or a Compose service and Traefik routes the hostname to its container. Without a domain of your own, use a generated domain over HTTP.

How domains are applied

ApplicationsDocker Compose
MechanismOne Traefik file per domain (File Provider)Traefik Docker labels in the compose file
Where to see itProxy › Config files on the server page, or the proxy config under the service's Settings › NetworkingThe compose file
After a changeApplied immediately, no redeployRedeploy required

For an application with HTTPS, wtree Cloud writes a file like this:

http:
  routers:
    w3panel-app-name-router-1:
      rule: Host(`your-domain.com`)
      service: w3panel-app-name-service-1
      middlewares:
        - redirect-to-https
      entryPoints:
        - web
    w3panel-app-name-router-websecure-1:
      rule: Host(`your-domain.com`)
      service: w3panel-app-name-service-1
      middlewares: []
      entryPoints:
        - websecure
      tls:
        certResolver: letsencrypt
  services:
    w3panel-app-name-service-1:
      loadBalancer:
        servers:
          - url: http://w3panel-app-name:3000
        passHostHeader: true

If a domain change has no effect, check the Traefik logs. For Compose labels, see Compose domains.

Domain settings

Open the service and go to Settings › Domains, then click Add domain.

SettingWhat it doesDefault
HostHostname to serve, for example api.example.com.None
PathPublic path prefix the domain answers on./
Internal pathPrefix added to the request path before it reaches the container.None
Strip pathRemoves Path from the request before forwarding.Off
Container portPort inside the container that Traefik routes to.None
Custom entrypointA Traefik entrypoint other than web/websecure. Advanced.None
HTTPSServes the domain over TLS.Off
Certificate providerNone, Let's Encrypt or Custom Resolver.None

Certificate providers:

  • None: uses a certificate you uploaded under Certificates whose name matches the host.
  • Let's Encrypt: issues and renews a free certificate.
  • Custom Resolver: uses a cert resolver you added to Traefik's static configuration (traefik.yml), for example myresolver. Not for uploaded certificates.

Container port only tells Traefik where to send traffic inside the Docker network. It does not publish the port. To publish a port on the host, use Settings › Networking › Ports.

Apps with the Static build type, or Nixpacks with a Publish Directory, serve on port 80. Use 80 as the container port.

Rewrite paths

Internal path and Strip path are Traefik middlewares. When both are on, Strip path runs first.

HostPathStrip pathInternal pathRequestContainer receives
api.example.com/v1Off/backend/api/v1/users/backend/api/users
app.example.com/dashboardOnNone/dashboard/settings/settings
service.example.com/publicOn/app/v2/public/api/users/app/v2/api/users

If your app builds redirects or absolute URLs that ignore the rewritten path, you can get redirect loops or broken links. Test the app behind the rewrite.

Custom entrypoints

An entrypoint is a port and protocol Traefik listens on. wtree Cloud ships web (HTTP, 80) and websecure (HTTPS, 443). Don't remove or rename them: domain routing, HTTPS and redirects depend on them.

With HTTPS on and no custom entrypoint, wtree Cloud creates one router for web, one for websecure, and a middleware that redirects HTTP to HTTPS.

With a custom entrypoint:

  • wtree Cloud creates a single router on that entrypoint only, using HTTP or HTTPS according to the HTTPS setting.
  • No HTTP to HTTPS redirect is created. Handle it in the Traefik configuration, or add a second domain on an HTTP entrypoint.
  • The entrypoint must already exist in Traefik's static configuration, or the router fails.
traefik.yml
entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
  external-secure:
    address: ":8443"
  internal-secure:
    address: ":9443"

Here external-secure can face the internet while internal-secure is bound to a private interface or firewalled. To publish the extra ports through Traefik, see Web server settings.

A wrong entrypoint can make a service unreachable or expose it unintentionally. Use this only if you know Traefik.

Redirect www to the apex domain

  1. At your DNS host, add a CNAME record: name www, value example.com.
  2. Create a domain in wtree Cloud with the host www.example.com.
  3. Open the application's Settings › Networking, click Add redirect under Redirects, pick the Redirect to non-www preset and save.

Requests to www.example.com now redirect to example.com.

Next steps

On this page