Skip to content
App
Markdown

Custom domains

Declare a domain in the manifest and it is routed and certified — one canonical hostname, the rest redirect.

Declaring a domain in the manifest is the provisioning step: it makes the hostname routable and certifiable at once. There is no separate domain dashboard, and the platform never asks for your DNS credentials.

{
  "name": "my-site",
  "auth": "public",
  "assets": "dist",
  "custom_domains": ["example.fi", "www.example.fi"],
  "canonical_host": "www.example.fi"
}

Point the domain's DNS at your app's platform name, my-site.pilvia.app on the hosted platform (a CNAME for both apex and www is the recommended shape — apex flattening at your DNS provider handles the root). A self-hosted installation has its own address, which its operator gives you. The first request on a new hostname triggers on-demand certificate issuance; expect the first hit to take a few seconds, and every one after that to be ordinary.

http:// requests are redirected to https:// with the path and query intact.

Connections are TLS 1.3 or 1.2. A TLS 1.3 client that offers the post-quantum hybrid key exchange X25519MLKEM768 gets it, which is meant to keep traffic recorded today safe from a future quantum computer; any other client gets X25519 or an elliptic curve. Behind Cloudflare's proxy (below), the visitor's key exchange is the one Cloudflare negotiates.

One site, one hostname

A real site arrives with two names — example.fi and www.example.fi — and serving both identically means one page at two addresses: split search ranking, a sitemap that disagrees with the URL bar, two cookie jars. canonical_host picks the one hostname content is served on; the other declared domains answer with a 301 to it, path and query intact.

Two rules keep this safe and useful:

  • The canonical host must be one of the app's own custom_domains. A redirect can only point at a name the app already serves and holds a certificate for — a manifest cannot turn the platform into a redirector for somebody else's traffic. A violation is refused at deploy time with a readable message.
  • The platform hostname (<name>.pilvia.app) never redirects. It is the preview address — the one you test on before DNS moves, and after it breaks. A preview that bounces to production is not a preview.

Behind Cloudflare's proxy

A name can stay proxied (the orange cloud). The platform normally proves to Let's Encrypt that it serves a name by answering on that name's TLS port, where Cloudflare's proxy would answer instead. So when the request that starts a certificate arrives from Cloudflare, the platform proves the name over plain HTTP, which passes through the proxy. Renewals go the same way.

One Cloudflare setting can block a name's first certificate. With "Always Use HTTPS" on, Cloudflare sends Let's Encrypt's check to https://, and a zone in "Full (strict)" refuses an origin that has no certificate yet. Turn "Always Use HTTPS" off until the name has answered once, then turn it back on. Renewals are not affected.

This is the hosted platform's router. A single-server installation proves names on the TLS port only, so there the records stay DNS only (the grey cloud).

When a request arrives through Cloudflare, the platform reads it as follows:

  • The visitor's address is the visitor's. CF-Connecting-IP is believed only from Cloudflare's published address ranges. Your app then sees the visitor's own address in x-forwarded-for and x-real-ip, and their location in the x-pilvia-ip-* headers, not Cloudflare's. A copy of Cloudflare's headers sent from anywhere else is removed before your app sees the request.
  • Every name is HTTPS only. A visitor who came to Cloudflare over http:// is redirected to https://.
  • SSL/TLS mode "Flexible" does not work. In that mode Cloudflare reaches the platform over plain HTTP, the platform redirects it to HTTPS, and the browser loops. Use "Full (strict)".

Under the base domain

Names under the platform zone route by app name only — an app cannot declare something.pilvia.app as a custom domain and claim another app's address. Custom domains are for names you own.

The one name under the zone an app may declare is its own <name>.pilvia.app. Declaring it changes how search engines see the name: an undeclared platform name answers with x-robots-tag: noindex, nofollow, and a declared one does not. Declare it when the platform name is the site's public address. See Request IDs and headers.

Type to search. ↑↓ to move, Enter to open, Esc to close.