Domain
Configure basecamp-sherpa.com DNS on Namecheap with Railway and wildcard subdomains for agent instances.
Overview
Each agent instance gets a unique subdomain under agent.basecamp-sherpa.com. A wildcard DNS record routes all subdomains to the agent Railway service — no DNS changes needed per instance.
https://acme.agent.basecamp-sherpa.com/webhooks
https://xyz.agent.basecamp-sherpa.com/webhooksDNS Records (Namecheap)
Configure these in Namecheap → Domain List → Manage → Advanced DNS:
| Type | Host | Value | TTL |
|---|---|---|---|
CNAME | www | <console-service>.up.railway.app | Auto |
CNAME | console | <console-service>.up.railway.app | Auto |
CNAME | *.agent | <agent-service>.up.railway.app | Auto |
URL Redirect | @ | https://www.basecamp-sherpa.com | — |
Namecheap does not support CNAME records at the apex (@). Use a URL Redirect from @ to https://www.basecamp-sherpa.com, or switch to a DNS provider that supports ALIAS/ANAME records (e.g. Cloudflare).
Railway Custom Domains
Add domains to the Console service
In Railway, go to Console service → Settings → Networking → Custom Domain and add:
basecamp-sherpa.comwww.basecamp-sherpa.comconsole.basecamp-sherpa.com
Add wildcard domain to the Agent service
In Railway, go to Agent service → Settings → Networking → Custom Domain and add:
*.agent.basecamp-sherpa.com
Railway automatically provisions a wildcard TLS certificate via Let's Encrypt.
Domain Map
| URL | Service | Purpose |
|---|---|---|
basecamp-sherpa.com | Console | Redirects to www |
www.basecamp-sherpa.com | Console | Marketing & landing page |
console.basecamp-sherpa.com | Console | SaaS dashboard |
<slug>.agent.basecamp-sherpa.com | Agent | Per-instance webhook receiver |
Instance Routing
The agent service extracts the subdomain from the Host header to identify which instance the request belongs to:
const host = req.headers.get("host"); // "acme.agent.basecamp-sherpa.com"
const slug = host?.split(".")[0];
const { data: instance } = await supabase
.from("instances")
.select()
.eq("slug", slug)
.single();Each instance's webhook URL is:
https://<slug>.agent.basecamp-sherpa.com/webhooksProvisioning Flow
When a new instance is provisioned:
- Worker generates a unique slug (e.g.
acme-corp) - Slug is stored in the
instancestable - The wildcard DNS + Railway domain handle routing automatically
- User receives their webhook URL immediately — no DNS propagation delay
No per-instance DNS or Railway configuration is needed. The wildcard covers all subdomains.
Migrating to Cloudflare (Optional)
For DDoS protection and edge caching, you can move DNS to Cloudflare:
- Create a Cloudflare account and add
basecamp-sherpa.com - Update nameservers on Namecheap to Cloudflare's
- Recreate the same DNS records in Cloudflare
- Cloudflare supports
CNAMEflattening at the apex — no redirect needed for@