🚀 JPF Products Proof-of-Concept: Wildcard Subdomain Multi-Tenancy Architecture
J
JPF Productsjpfproducts.in
Multi-Tenant Subdomain Platform
Single Next.js App • Unlimited Dynamic Subdomains

Wildcard Subdomain Multi-Tenancy Demo

Learn how jpfproducts.in routes traffic dynamically based strictly on the request Host header—serving completely isolated tenant storefronts from a single Next.js codebase.

Available Demo Environments

Select a Tenant Subdomain

Each subdomain loads isolated mock data, custom branding, distinct color themes, and tenant-specific products.

Raghu Electronics

raghu.jpfproducts.in
Tenant: raghu

Cutting-edge audio devices, high-refresh displays, and ergonomic workstation gear built for tech enthusiasts.

Product Highlights
Quantum ANC Wireless Headphones ($299)UltraSharp 32" 4K OLED Monitor ($799)MechKeys Pro Wireless Keyboard ($149)

Nadella Fashion

nadella.jpfproducts.in
Tenant: nadella

Handcrafted Italian leather accessories, mulberry silk garments, and timeless designer silhouettes.

Product Highlights
Artisan Mulberry Silk Evening Dress ($450)Italian Full-Grain Leather Tote ($320)Titanium Frame Polarized Sunglasses ($210)

Nithin Mobiles

nithin.jpfproducts.in
Tenant: nithin

Authorized store for high-tier smartphones, wireless audio, MagSafe charging, and gaming accessories.

Product Highlights
Zenith Phone 15 Pro Max (512GB) ($1199)Apex Fold 3 Dual Screen ($1499)MagCharge 20,000mAh Power Core ($79)

Ravi Furniture

ravi.jpfproducts.in
Tenant: ravi

Sustainably sourced hardwood furniture, ergonomic office setups, and architectural lighting solutions.

Product Highlights
Artisan Solid Oak Executive Desk ($850)Nordik Ergonomic Mesh Task Chair ($420)Velvet Curved Lounge Armchair ($640)
Negative Test Case

Test Unknown Subdomain Handling

Visiting an unregistered subdomain (e.g., unknown.jpfproducts.in or unknown.localhost:3000) cleanly triggers the custom Tenant Not Found page.

Visit unknown.localhost:3000
Under The Hood

How Hostname Multi-Tenancy Works

No query parameters (?tenant=raghu). No URL paths (/raghu). Clean hostname detection only.

1
Browser Request

raghu.jpfproducts.in

2
Wildcard DNS

*.jpfproducts.in → Server IP

3
Next.js middleware

Extract Host header: "raghu"

4
Internal Rewrite

NextResponse.rewrite(/tenant/raghu)

5
Render Storefront

URL stays raghu.jpfproducts.in

Zero Configuration Local Testing

How Localhost Testing Works

Modern web browsers (Chrome, Firefox, Edge, Brave, Safari) natively resolve any subdomain ending with .localhost directly to 127.0.0.1. You do not need to edit system hosts files or install local proxy tools!

Start dev server: npm run dev
Visit http://raghu.localhost:3000 in your browser
Middleware automatically parses raghu as the tenant key
Terminal Local CommandsPowerShell / Bash
# Start local Next.js dev server
npm run dev
# Test HTTP request headers via curl
curl -H "Host: raghu.localhost:3000" http://localhost:3000
Production Setup Guide

Configuring Wildcard DNS & SSL

How to configure domain provider records for *.jpfproducts.in on Vercel, Cloudflare, or custom servers.

1. DNS Record Configuration

Add wildcard record to DNS Registrar
Type: CNAMEName: *
Target: cname.vercel-dns.com (or server IP)

Adding *.jpfproducts.in causes all subdomains (raghu, nadella, etc.) to resolve to your server IP automatically without creating individual DNS entries.

2. Wildcard SSL Certificate

HTTPS for all subdomains
✓ Automated via Vercel / Cloudflare
Domain added to Vercel project: *.jpfproducts.in

Platforms like Vercel automatically issue a single Wildcard Let's Encrypt SSL certificate covering both jpfproducts.in and *.jpfproducts.in.