Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.
Assigning a custom subdomain to a Fly app#
I deployed an app to Fly and decided to point a custom subdomain to it.
My fly app is https://datasette-apache-proxy-demo.fly.dev/
I wanted the URL to be https://datasette-apache-proxy-demo.datasette.io/ (see issue #1524).
Relevant documentation: SSL for Custom Domains.
Assign a CNAME#
First step was to add a CNAME to my datasette.io domain.
I pointed CNAME of datasette-apache-proxy-demo.datasette.io at datasette-apache-proxy-demo.fly.dev. using Vercel DNS:

Issuing a certificate#
Fly started serving from http://datasette-apache-proxy-demo.datasette.io/ as soon as the DNS change propagated. To get https:// to work I had to run this:
1% flyctl certs create datasette-apache-proxy-demo.datasette.io2Your certificate for datasette-apache-proxy-demo.datasette.io is being issued. Status is Awaiting certificates.I could then run this command periodically to see if it had been issued, which happened about 53 seconds later:
1apache-proxy % flyctl certs show datasette-apache-proxy-demo.datasette.io2The certificate for datasette-apache-proxy-demo.datasette.io has been issued.3
4Hostname = datasette-apache-proxy-demo.datasette.io5
6DNS Provider = constellix7
8Certificate Authority = Let's Encrypt9
10Issued = ecdsa,rsa11
12Added to App = 53 seconds ago13
14Source = fly