Set Up a Custom Domain
To route traffic to the services running on your AWS EC2 instance, you need to configure DNS A records through your domain registrar.
Step 1: Go to your domain registrar:
Log in to your domain registrar’s DNS management panel (e.g., GoDaddy, Namecheap, Cloudflare).
Step 2: Create A Records Pointing to Your EC2 Instance
You will need to create five A records, one for each service, all pointing to the public IPv4 address of your EC2 instance.
- Example DNS Records
| Type | Name (Host) | Value (Points to) | TTL |
| -------- | --------------- | --------------------- | ------------ |
| A | `backend` | `YOUR_PUBLIC_IP` | 3600 or Auto |
| A | `auth` | `YOUR_PUBLIC_IP` | 3600 or Auto |
| A | `app` | `YOUR_PUBLIC_IP` | 3600 or Auto |
| A | `socket` | `YOUR_PUBLIC_IP` | 3600 or Auto |
| A | `proxy` | `YOUR_PUBLIC_IP` | 3600 or Auto |
Replace YOUR_PUBLIC_IP with the actual public IPv4 address of your EC2 instance.
Each of these subdomains (e.g., backend.yourdomain.com, auth.yourdomain.com, etc.)
will allow external access to the corresponding services on your server.
Note: DNS changes may take a few minutes to several hours to propagate.