Domains, DNS & CDN
Everything about your app's hostname: how it becomes a DNS record, how
several apps share one domain, why nobody can steal your host, and how
to put a CDN in front — all from pagifier.toml.
Your host becomes a DNS record automatically
Declare the host; the platform's external-dns (running with a zone-scoped service-account identity on Route53 / Cloud DNS / Azure DNS / Cloudflare) creates and removes the record from the Ingress Pagifier renders:
ingress = "shop.company.com"
Tune the record with the dns block:
[dns]
ttl = 300 # record TTL in seconds
target = "d1234abcd.cloudfront.net" # point the domain somewhere else (see CDN)
Nothing to click, nothing to clean up — preview environments' records disappear with the preview.
Hostnames are owned, not shared by accident
The first application to deploy a (host, path) pair owns it. Any
other application — in your tenant or anyone else's — that tries to
deploy to the same pair gets a hard 409:
host www.abc.com path / is already owned by acme/frontend in prod; choose another host or path
Rules worth knowing:
- Same app redeploying: always fine — ownership is per tenant + application + environment.
- Moving to a new host releases the old claim on the next deploy, so hostnames aren't locked forever.
- Ownership is exact on the
(host, path)pair — which enables the next section.
Path-based ingress: several apps, one domain
Different paths on one host are different claims, so teams compose a domain out of independent apps:
# team storefront — owns www.abc.com/
name = "storefront"
ingress = "www.abc.com"
# team blog — owns www.abc.com/blog, deploys independently
name = "blog"
[ingress]
host = "www.abc.com"
path = "/blog"
nginx routes the most-specific path first, so /blog/* hits the blog
app and everything else hits the storefront. Each app keeps its own
releases, rollbacks, and canaries; neither can take the other's path.
ingress.path decides which app owns a URL prefix at the edge.
The routes block is different: it makes your nginx proxy a path to
another service (/api → the backend) within your app's traffic.
Use ingress.path for ownership, routes for same-host API proxying.
Putting a CDN in front
One line opts into your platform's CDN integration:
cdn = "cloudfront" # or cloud-cdn, front-door, cloudflare — ask your platform team
What happens: the platform's cdn/cloudfront.yaml document (owned by
the platform team, versioned in the config bucket) resolves into your
release — typically it points your DNS record at the distribution
(dns.target semantics), adds origin-protection so only the CDN can
reach the cluster, and relies on your cache block for edge caching
policy:
cache = {static = "365d", html = "5m"} # hashed assets cache at the edge for a year
Like authentication middleware, CDN annotations override project
annotations — edge policy stays platform-owned — and an unknown
provider fails the upload naming the missing document
(cdn provider "akamai" requires cdn/akamai.yaml).
Platform teams: seed definitions for CloudFront, Cloud CDN, Front Door,
and Cloudflare ship in examples/platform-config/cdn/; the
object storage reference
documents the schema.