Custom Domains
PageGun supports three hosting modes, each with different levels of control over your domain and rendering.
Hosting Modes
| Mode | Domain | Rendering | Best For |
|---|---|---|---|
| Full Host | Your domain via CNAME | PageGun renders | Simple sites, landing pages |
| Rewrite | Your domain via proxy | PageGun renders | Embedded docs within existing sites |
| Data Mode | Your domain, your app | You render | Full control, custom frontends |
Full Host
PageGun fully hosts your site. Visitors go to your domain; PageGun serves the pages.
Setup
- Add your domain in Project Settings → Domains.
- Create a DNS CNAME record:
docs.example.com CNAME hosting.pagegun.com- Wait for DNS propagation (usually < 5 minutes).
- PageGun automatically provisions an SSL certificate.
Rewrite Mode
Your existing application proxies specific routes to PageGun. This lets you embed PageGun content within your own site.
Vercel
In vercel.json:
{
"rewrites": [
{ "source": "/docs/:path*", "destination": "https://hosting.pagegun.com/docs/:path*" }
]
}Netlify
In netlify.toml:
[[redirects]]
from = "/docs/*"
to = "https://hosting.pagegun.com/docs/:splat"
status = 200Cloudflare Workers
export default {
async fetch(request: Request) {
const url = new URL(request.url)
if (url.pathname.startsWith('/docs')) {
return fetch(`https://hosting.pagegun.com${url.pathname}`, {
headers: { 'Host': 'hosting.pagegun.com' }
})
}
return fetch(request)
}
}Nginx
location /docs/ {
proxy_pass https://hosting.pagegun.com/docs/;
proxy_set_header Host hosting.pagegun.com;
proxy_ssl_server_name on;
}Data Mode
In Data Mode, there's no domain configuration needed on PageGun's side. Your application fetches encrypted content from the CDN and renders it however you want.
→ See the Data Mode Guide for details.
SSL Certificates
For Full Host and Rewrite modes, PageGun automatically provisions and renews SSL certificates via Let's Encrypt. No manual configuration is required.
Domain Verification
When you add a custom domain, PageGun may ask you to verify ownership by adding a TXT record:
_pagegun-verify.docs.example.com TXT pgv_xxxxxxxxxxxxxVerification typically completes within a few minutes.