Docs / Guides
HTTPS and custom domains
yasp can serve HTTPS itself, with certificates it gets and renews automatically, for the base URL's host and for every status page's custom domain. Behind a reverse proxy or load balancer that already terminates TLS, leave [tls] out.
# Automatic certificates (ACME)
base_url = "https://status.example.com"
listen = "0.0.0.0:443"
[tls]
acme_email = "ops@example.com"
- Port 443 serves HTTPS (HTTP/2 and HTTP/1.1). Port 80 (
http_listen) answers ACME HTTP-01 challenges and redirects everything else to HTTPS, so both must be reachable from the internet. - The base host gets a certificate, and so does every custom domain set on a status page (Dashboard → Status pages → a page → Address). A new domain gets its certificate within a minute once its DNS points at yasp.
- Certificates renew when a third of their lifetime is left. Failed attempts back off (1 hour, doubling up to a day), and the log says why, usually DNS not pointing here yet or port 80 being blocked.
- The ACME account key and certificate keys are stored encrypted in the database, so backups and standby instances have them.
| Setting | Default | |
|---|---|---|
acme_email | none | Contact for the CA; turns ACME on |
acme_directory | letsencrypt | letsencrypt-staging while testing, or a URL: ZeroSSL, Google Trust Services, step-ca, Pebble |
acme_ca_file | none | PEM root for a private directory's own HTTPS (step-ca, Pebble) |
acme_base_host | on when no cert | Also get a certificate for the base URL's host |
http_listen | 0.0.0.0:80 | Challenges and redirects |
# Your own certificate
[tls]
cert = "/etc/yasp/fullchain.pem"
key = "/etc/yasp/privkey.pem"
The file certificate is used for any host without an ACME certificate. Both can be combined: your certificate for the base host, ACME for custom domains. yasp reads the files at startup, so restart it after renewing them.
# Custom domains
- Add the domain on the page's settings (Address → Custom domain).
- Create a DNS record pointing it at yasp: a
CNAMEto the base host, orA/AAAArecords. - With ACME on, the certificate follows by itself; the page settings show when it's valid until.
Requests are matched to a page by host name, so the same yasp serves status.example.com, status.product.com and /p/{id} paths at once.