Setting Up a Custom Subdomain with Route53 and Fly.io
I built this face shape identifier tool that helps people get personalized hairstyle recommendations based on their face shape, after looking up information on how to choose the right hairstyle for my own face shape. After deploying it to fly.io, I wanted to make it accessible through a subdomain of my main website anoliphantneverforgets.com.
Here's how I set it up:
Prerequisites
Before starting, you'll need:
- A domain managed by AWS Route53
- A deployed application on Fly.io
- The Fly CLI installed
Step-by-Step Configuration
1. Plan Your Subdomain
I chose `faceshapeidentifier.anoliphantneverforgets.com` for my tool.
2. Generate SSL Certificate
Run this command to add a certificate:
fly certs add faceshapeidentifier.anoliphantneverforgets.com
Fly.io will give you the CNAME record details you need for the next step.
3. Configure Route53
- Go to Route53 in the AWS console
- Navigate to Hosted zones → your domain
- Click "Create record" and set up:
- Record name: `faceshapeidentifier`
- Record type: `CNAME`
- Value: `face-shaper.fly.dev`
- TTL: 300 seconds
4. Verify Everything Works
The DNS changes usually take 5-30 minutes to propagate. You can check the status with:
dig faceshapeidentifier.anoliphantneverforgets.com CNAME
If things aren't working:
- Check the certificate status:
fly certs show faceshapeidentifier.anoliphantneverforgets.com
- Make sure your app is running:
fly status
Want to learn more? Check out the Fly.io custom domain docs or the AWS Route53 guide.