Skip to Content
Networking

Domains and HTTPS

Every option of an app's domains - certificates, path routing, www redirect, CORS and a login in front.

Every hostname an app answers on is a row in the app's Domains tab. For your first one, follow Add a domain. This page covers every option after that.

One app's Domains tab with its hostname, DNS state and certificate
  • Star: makes the domain primary, the app's main URL. There is always exactly one.
  • Refresh: checks the DNS again now.
  • Pencil: opens every option below.

DNS states

StateWhat it meansRouted
ValidThe hostname points at this app's serveryes
ProxiedIt points at Cloudflare's proxyyes
PendingNothing resolves yet. The row prints the A record to createno
MisconfiguredAn A or AAAA record points at another machine. The row names itno

Behind a CDN Deplo does not recognise, turn on Advanced settings -> Proxy -> Behind a proxy. The domain is then routed without a DNS check.

Certificates

HTTPS -> Certificate in the domain's dialog:

CertificateUse it for
None (no certificate)Plain HTTP. What a new domain starts on
Let's EncryptThe usual choice. Issued and renewed for you; port 80 must stay open
CloudflareA domain behind Cloudflare's proxy in Full mode
Your own certificateOne an instance admin uploaded, like a wildcard. See Custom certificates
The Add a domain dialog: container, port, certificate issuer and entrypoint

Behind Cloudflare's proxy, set Cloudflare's SSL mode to Full (strict) and pick Let's Encrypt.

Path routing

Send example.com/api and example.com/ to two different apps. Open Advanced settings -> Request routing:

Advanced settings of the same dialog, where path routing and redirects live
FieldWhat it does
Internal path (optional)Only requests under this path reach this app, like /api
Strip path before forwardingThe app receives /users instead of /api/users
Middlewares (optional)Traefik middlewares, comma-separated, applied in order

The longest path wins. A domain with no path takes everything else.

In a Compose app, also pick the Container and its Application port at the top of the dialog.

Redirects

Advanced settings -> Redirect -> www redirect sends www.example.com to example.com, or the other way round, with a permanent 301. The other hostname needs its own DNS record.

Security headers and CORS

Both under Advanced settings -> Security:

  • Security headers, on by default, adds X-Content-Type-Options, X-Frame-Options and Referrer-Policy. Turn it off when another site shows yours in a frame.
  • Allowed origins (optional) lists the sites whose pages may call this domain from the browser (CORS), up to 20. * allows any. For an API on api.example.com:
https://app.example.com, http://localhost:5173

HTTP basic auth

Put a username and password in front of every domain of the app: Settings -> Access -> Add credential. It applies within seconds, with no redeploy, and needs Manage HTTP basic auth.

Good to know

  • Changes apply at once while the app runs, otherwise on its next deploy.
  • A domain that serves stays online. A later failed DNS check shows a warning but never stops it.
  • A team has 50 Let's Encrypt domains. Open pull request previews with one count too.

Something wrong? See Domains and TLS.

Did this page help you?

On this page