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.
- 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
| State | What it means | Routed |
|---|---|---|
| Valid | The hostname points at this app's server | yes |
| Proxied | It points at Cloudflare's proxy | yes |
| Pending | Nothing resolves yet. The row prints the A record to create | no |
| Misconfigured | An A or AAAA record points at another machine. The row names it | no |
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:
| Certificate | Use it for |
|---|---|
| None (no certificate) | Plain HTTP. What a new domain starts on |
| Let's Encrypt | The usual choice. Issued and renewed for you; port 80 must stay open |
| Cloudflare | A domain behind Cloudflare's proxy in Full mode |
| Your own certificate | One an instance admin uploaded, like a wildcard. See Custom certificates |
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:
| Field | What it does |
|---|---|
| Internal path (optional) | Only requests under this path reach this app, like /api |
| Strip path before forwarding | The 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-OptionsandReferrer-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 onapi.example.com:
https://app.example.com, http://localhost:5173HTTP 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?