Request Lifecycle: From Guest Browser to Rendered Site
Guest Request
Guest opens https://himalayan.reserveanddine.com
Cloudflare DNS
Wildcard CNAME matches and terminates TLS 1.3 with Universal SSL.
Next.js Edge Proxy
Extracts slug and internally rewrites to /tenant-sites/[slug].
Live Website
Renders branded room catalog, rates, direct checkout, and policies.
Cloudflare DNS Configuration
In your Cloudflare dashboard under your domain reserveanddine.com, navigate to DNS > Records. You have two architectural choices:
| Type | Name | Target / Value | Proxy Status | Copy |
|---|---|---|---|---|
| CNAME | * | cname.vercel-dns.com | DNS Only (Grey) or Proxied (Orange) | |
| A or CNAME | @ | 76.76.21.21 (or cname.vercel-dns.com) | Proxied (Orange) | |
| CNAME | www | reserveanddine.com | Proxied (Orange) |
💡 If hosting with Vercel, point the CNAME to cname.vercel-dns.com. If on your own server or Docker container, point to your VPS IPv4 address.
stay.reserveanddine.com) to point to a specific hotel:| Type | Name | Target / Value | Proxy Status | Copy |
|---|---|---|---|---|
| CNAME | [sub-domain] (e.g. stay) | cname.unlockinn.com | DNS Only (Grey) or Proxied (Orange) |
Cloudflare SSL/TLS Settings (Full Strict)
Never set Cloudflare encryption mode to Flexible. Flexible causes Cloudflare to forward requests to the origin over HTTP (port 80), but Next.js forces an HTTPS redirect, causing an infinite ERR_TOO_MANY_REDIRECTS loop.
Set Encryption to Full or Full (Strict)
Navigate to SSL/TLS > Overview. Select Full (Strict). Cloudflare will encrypt all traffic end-to-end between the guest browser and your hosting server.
Universal SSL & HTTPS Rewrites
Under SSL/TLS > Edge Certificates, verify Universal SSL is active. It automatically covers *.reserveanddine.com. Toggle ON Always Use HTTPS.
Edge Router Environment Configuration
UnlockInn’s edge router in apps/sites/src/proxy.ts dynamically extracts subdomains. To recognize reserveanddine.com as a SaaS root domain, add it to your environment variables:
# Multi-Tenant Root SaaS Domains ROOT_DOMAINS="reserveanddine.com, unlockinn.com" MARKETING_DOMAINS="reserveanddine.com, www.reserveanddine.com"
When a request arrives for https://grand-palace.reserveanddine.com, the proxy automatically strips the root domain, resolves slug grand-palace, and rewrites the path internally to /tenant-sites/grand-palace.
Connect Subdomain in the Dashboard
Ready to connect your property?
Open your property’s domain settings in the dashboard to set or verify your subdomain and custom domain mapping.
If the hotel’s slug is grand-palace, it will be accessible immediately at https://grand-palace.reserveanddine.com once Step 1 & 3 are complete.
In Dashboard > Appearance > Custom Domain input field, enter stay.reserveanddine.com or your custom domain and click Save.
Testing Locally & Troubleshooting
Test locally with .localhost
You do not need to wait for DNS propagation to test. Simply navigate to:
http://[sub-domain].localhost:8010Modern browsers automatically loop *.localhost to 127.0.0.1.
Verify DNS Propagation via CLI
Run the following command in terminal to check if the CNAME resolves:
dig CNAME yoursub.reserveanddine.com +short| Symptom | Cause | Resolution |
|---|---|---|
| ERR_TOO_MANY_REDIRECTS | Cloudflare SSL set to Flexible | Change Cloudflare SSL mode to Full (Strict). |
| 404 Property Not Found | Tenant slug or status mismatch in database | Ensure Tenant table has slug = '[sub-domain]' and status = 'ACTIVE'. |
| Shows Marketing Landing Page | ROOT_DOMAINS missing in env | Add ROOT_DOMAINS="reserveanddine.com" to apps/sites/.env. |
| Error 525 / 526 SSL Handshake | Origin certificate expired or self-signed | Install a free Cloudflare Origin CA certificate on your server, or use DNS Only mode with Let's Encrypt. |