Custom HTTPS Domain for Next.js
Use agentdomains proxy for Next.js on Railway, Fly.io, or Render. On Vercel, add a custom domain CNAME because Vercel checks the Host header.
Origin-to-edge flow for Next.js: connect my-next-app.vercel.app to next-demo.agentdomains.co with automatic HTTPS.
1. Choose Mode: Edge Proxy vs DNS-01
Edge HTTPS Reverse Proxy
RECOMMENDED- Point at any public hostname without
https://. - Cloudflare edge handles TLS 1.3 automatically.
- Zero Certbot config and zero IP exposure.
A Record + ACME DNS-01
FOR BARE VPS- Point directly at your server IPv4 or IPv6 address.
- Issue certs via Caddy or
agentdomains txtDNS-01. - Works even when your firewall blocks port 80.
agentdomains signup
agentdomains claim next-demo --email you@example.com --domain agentdomains.co
agentdomains proxy next-demo my-next-app.vercel.app --domain agentdomains.co
2. Interactive: Generate My CLI Command
Enter your subdomain label and origin below. Copy the generated commands or check live name availability.
3. Next.js Origin Configuration
Apply this config on Next.js so headers, TLS, and routing match your new hostname.
# In next.config.mjs, allow your AgentDomains hostname for Server Actions if proxied:
export default {
experimental: {
serverActions: { allowedOrigins: ['next-demo.makes.fyi'] }
}
};
Operational Checklist
- Set
NEXTAUTH_URL=https://next-demo.makes.fyi(or Auth.jsAUTH_URL) so OAuth callbacks match your public hostname. - For self-hosted Next.js on a VPS, run
next start -p 3000behind Caddy with an A record.
Frequently asked questions
Should I use edge proxy or an A record for Next.js?
Use agentdomains proxy for Next.js on Railway, Fly.io, or Render. On Vercel, add a custom domain CNAME because Vercel checks the Host header.
How do I check DNS propagation for Next.js?
Open /tools/dns-ssl-checker or run dig @1.1.1.1 next-demo.agentdomains.co. Confirm both Cloudflare and Google return your record.
Can an AI agent configure Next.js routing via MCP?
Yes. Connect your client to https://mcp.agentdomains.co. Ask it to call claim_domain and set_proxy.
Related Host Playbooks
FastAPI (Python)
Deploy FastAPI on Fly.io, Railway, or Render. Add agentdomains proxy so /docs and /openapi.json serve over HTTPS.
Express.js (Node)
Use agentdomains proxy for PaaS Express apps, or an A record on a VPS. Enable trust proxy so req.ip works right.
Go net/http
Point an A record at your Linux server. Serve HTTPS directly with Go autocert and skip external proxies.
Flask (Python)
Use agentdomains proxy in front of Render/Railway/Fly Gunicorn deployments and wrap Flask with Werkzeug’s ProxyFix middleware.
Claim your agent domain now
Start with 10 free HTTPS domains under agentdomains.co or makes.fyi for 30 days. Upgrade to Pro for $10/year to keep up to 100 names with visitor stats.