Map a Custom Domain
You can point your domain (e.g., sparrow.example.com
) to the Sparrow VM to enable easy access and branding.
Step 1: Configure DNS A Record
Go to your DNS provider (Azure DNS, GoDaddy, Namecheap, etc.) and add an A record:
Setting | Value |
---|---|
Host | @ or desired subdomain (e.g., app ) |
Type | A |
Value | YOUR_VM_PUBLIC_IP |
TTL | 3600 or Auto |
Note: DNS changes may take a few minutes to several hours to propagate.
Step 2: Configure Nginx on the VM
Update your Nginx configuration to match your domain:
cd /etc/nginx/sites-available/
sudo nano sparrow
Edit the server_name directive to match your domain name:
server_name your-domain.com;
Shown below is the reference of nginx configuration corresponding to the steps mentioned above
Save and test your config:
sudo nginx -t
sudo systemctl restart nginx
Step 3: Set Up SSL with Certbot
To secure your domain with HTTPS:
sudo certbot --nginx -d YOUR_DOMAIN_NAME
- Certbot auto-renews with systemd timer.
Check the renewal status:
sudo systemctl status certbot.timer
You can test the renewal manually:
sudo certbot renew --dry-run
Verify Your Setup
Open your browser and check health endpoint:
https://YOUR_DOMAIN_NAME/health
You should see a success response from the health check API.