Domains and HTTPS

Hostnames, certificates, path-based routing and redirects for an app.

Every address an app answers on. For one domain with HTTPS, Add a domain is the short version.

  • A domain is one row: hostname plus path. Deplo turns each row into a proxy route with its certificate, middlewares, container and port.
  • A path route always wins over a whole-host route, longest path first. That is how example.com/api and example.com/ go to two different apps.
  • A row is routed only once its DNS check passes. See DNS states.
  • Changes apply at once while the app runs, otherwise on its next deploy. Reload on the app re-applies domains without a rebuild.

Add and manage domains

Open the app, then Domains -> Add Domain. Type the hostname, or press Generate for a free deplo.site one, then Add domain.

One app's Domains tab with its hostname, DNS state and certificate
  • Refresh icon: re-checks DNS now. It shows until the domain is valid.
  • Star: makes the domain primary, the app's URL in its header and in notifications. The first domain you add is primary, and there is always exactly one.
  • Pencil and bin: edit and remove. On a phone, all of these sit in the row's menu.

While the Domains page is open, Deplo re-checks a domain waiting for DNS every 30 seconds and starts routing the moment the record resolves.

Skip the DNS record

With your domain connected under Automatic DNS, Deplo creates the record when you add the domain.

DNS states

StateWhat it meansRouted
validThe hostname resolves to this app's serveryes
cloudflareIt resolves to Cloudflare's proxy, so the real origin cannot be checked. The row gets a Cloudflare badgeyes
pendingNothing resolves yet. The row shows the exact A record to create, and the AAAA when the server has IPv6no
misconfiguredIt resolves elsewhere, or one A or AAAA record points at another machine. The row names that recordno
  • A CDN or proxy Deplo does not recognise: turn on Behind a proxy under Advanced settings -> Proxy. The domain is then routed without a DNS check.
  • Twice a day Deplo re-checks every valid domain. One that no longer points here leaves valid and fires the Domain points elsewhere alert.

IPv6 and AAAA records

  • An A record alone is enough. The AAAA is optional.
  • With a public IPv6 on the server, the row prints the AAAA to create, for example app.example.com -> 2001:db8::10.
  • An AAAA pointing elsewhere makes the domain misconfigured, even next to a correct A record. Let's Encrypt checks over IPv6 whenever an AAAA exists, so the certificate would fail too.
  • Behind Cloudflare's proxy, the A record is enough. An AAAA alone needs a server with IPv6, or Cloudflare shows error 522.

Certificates

Certificate, in the dialog's HTTPS group, is how a domain gets HTTPS. There is no separate switch.

The Add a domain dialog: container, port, certificate issuer and entrypoint
CertificateWhat it does
None (no certificate)Plain HTTP. What a domain you add starts on
Let's EncryptValidated over HTTP on port 80, renewed automatically. Works directly or behind Cloudflare's Full and Full (strict)
CloudflareFor a Cloudflare-proxied domain: the server answers with a self-signed certificate. Works with Full, not Full (strict)
Installed on the serverOne an instance admin installed on that server. See Custom certificates

Deplo picks one for you in two cases:

  • A domain Cloudflare proxies moves from None to Let's Encrypt when you add or verify it.
  • The generated deplo.site address of an app on a server with a public IP gets Let's Encrypt. On a private IP it stays plain HTTP.

Entrypoint, in the same group, follows the certificate when left on Automatic. Pick web only when something in front already terminates TLS.

Behind Cloudflare

When you press Verify and twice a day, Deplo checks how Cloudflare reaches the server and switches a certificate that cannot work in that mode:

Cloudflare SSL modeDeplo switches the certificate to
FlexibleNone: Cloudflare reaches the server over plain HTTP
FullLet's Encrypt, if the domain had none
Full (strict)Let's Encrypt, if it had Cloudflare or none
  • Each switch is in the app's Activity, signed by Deplo. A certificate installed on the server is never switched.
  • Past the team's Let's Encrypt limit, a domain keeps Cloudflare.

Cloudflare Flexible mode

Flexible is HTTPS to the browser but plain HTTP to your server. Deplo follows it so the site works, but that last leg is not encrypted. Prefer Full (strict).

Path routing

Advanced settings of the same dialog, where path routing and redirects live
Advanced settings -> Request routingWhat it does
Internal path (optional)Only requests under this path reach this app. Blank routes the whole host
Strip path before forwardingRemoves the prefix before the request reaches your container
Middlewares (optional)Comma-separated Traefik middlewares, applied in order. Each must already exist on that proxy

What the row routes to sits at the top of the dialog: Container (Compose apps only) and Application port (the app's port by default). A Compose app must set both.

Example, two apps on one domain:

  • example.com/api goes to the API app, with internal path /api and strip path on. The API container receives /users instead of /api/users.
  • example.com/ goes to the web app, with no internal path.

Redirects

www redirect, under Advanced settings -> Redirect, sends www.example.com to example.com or the other way round, with a permanent 301. It only offers that pair, and is hidden when the hostname has no www or apex counterpart. The other hostname becomes a row of its own, with its own DNS check and certificate; the primary flag stays on the one that serves the app.

Security headers and CORS

Both under Advanced settings -> Security. Security headers, on by default, adds three headers to every response:

HeaderValueWhat it stops
X-Content-Type-OptionsnosniffThe browser guessing a file's type, so an upload cannot run as a script
X-Frame-OptionsSAMEORIGINAnother site showing yours inside a frame
Referrer-Policystrict-origin-when-cross-originFull URLs, query string included, leaking to other sites
  • Turn them off when another site embeds yours in a frame, like a widget or a dashboard.
  • A domain added before the setting existed, or imported from another platform, has them off.
  • There is no HSTS. It would keep browsers on HTTPS for months, even after the certificate is removed.

Allowed origins (optional) lists the sites whose pages may call this domain from the browser (CORS). * allows any; blank turns CORS off. For an API on api.acme.com called by app.acme.com:

https://app.acme.com, http://localhost:5173
  • An origin is a scheme and a host, with an optional port: https://app.acme.com, never https://app.acme.com/login. Up to 20 per domain.
  • Every method and any request header are allowed, Authorization included. The browser caches the answer for 10 minutes.
  • Cookies are not sent across sites. An app that needs them sets its own CORS headers; leave this blank then.

HTTP Basic Auth

Settings -> Access on the app. Add credential puts a browser login in front of every domain of the app, within seconds and with no redeploy. It needs manage_basic_auth.

Good to know

  • 50 Let's Encrypt domains per team. Open pull request previews with a Let's Encrypt hostname count too; domains with no certificate do not.
  • Port 80 must be open even for an HTTPS-only site. The certificate is validated there.
  • A hostname belongs to one team, and so does a preview base domain. Another team cannot add it.
  • Deplo's own panel address cannot be an app's domain.
  • The same hostname on two paths can belong to two apps in your team.

Troubleshooting

SymptomWhat to check
Certificate warning in the browserThe certificate is None or never issued: port 80 closed, or DNS pointing elsewhere.
This site is not runningThe app behind the address is stopped, or its last deploy failed.
404 from the proxyNo route matches: the app is stopped, or DNS points at a server the app is not on.
A redirect loopCloudflare Flexible plus an HTTPS redirect. Press Verify so Deplo follows the mode, or switch Cloudflare to Full (strict).

More in Domains and TLS.

Next steps

Did this page help you?

On this page