Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js Edge Middleware example that rewrites subdomains and custom domains to ISR-generated multi-tenant content pages.

Open-source Next.js starter kit from Astria for building an AI headshot generator SaaS, with Supabase auth, Stripe billing and Vercel deploy.

Example Next.js marketing site whose pages are assembled from Drupal Landing page nodes and paragraphs served over JSON:API.

Next.js 15 starter from PaddleHQ that adds a pricing page and a Paddle Billing web checkout openable from iOS apps, with Apple Pay support.

Example app wiring @upstash/ratelimit to Upstash Redis, with npm local dev and one-command Vercel deployment.
Hostname Rewrites is a Next.js Edge Middleware example from Vercel's public examples repository that maps incoming request hostnames — user subdomains and custom domains — to generated, ISR-powered content pages in a multi-tenant setup.
Hostname Rewrites is a reference implementation in Vercel's examples repository that shows how to programmatically generate unique content pages for each user of a multi-tenant platform. It reads the incoming request hostname in Edge Middleware and rewrites it to the page belonging to that host, so that a subdomain such as subdomain-1.vercel.sh and a custom domain such as custom-domain-1.com can serve the same site. Every generated page is statically produced with ISR — there is no SSR — so pages load quickly and inter-page transitions are fast.
Edge Middleware reads the hostname of each request, matches it against the tenant records, and rewrites the request internally to the corresponding static page. Those pages are generated ahead of time by Next.js data-fetching functions, with the mock database replaced by your own. Locally you run pnpm dev; in production you set ROOT_DOMAIN and add that domain as a wildcard domain on your Vercel project.
Yes. The repository ships with a mock database of three example sites, and the README instructs you to replace the data-fetching methods in getStaticPaths and getStaticProps with your own database — the template's term for this is bring your own database.
No. The README states that all generated sites are powered by ISR with no SSR at all, which is why pages load quickly and inter-page transitions are fast. Content is revalidated rather than rendered on each request.
Change ROOT_DOMAIN in your environment file from the default vercel.app to your own domain, then add that domain as a wildcard domain to your Vercel project. DEFAULT_DEV_HOST controls which hostname is used when developing on localhost.
The template is published as open-source code in Vercel's examples repository on GitHub, so you can clone it or bootstrap it with pnpm create next-app --example. Running it requires a Vercel project for deployment.
It is built with Next.js and styled with Tailwind CSS, and its routing logic runs in Next.js Edge Middleware. The README frames it specifically for people building platforms on Vercel.