{
  "id": 6942965,
  "title": "Path-Based Routing with Reverse Proxy: Serving Multiple Websites from One Domain",
  "url": "https://urgent.news/2026/09/12/path-based-routing-with-reverse-proxy-serving-multiple-websites-from",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-12T15:12:58.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/solitrix02/path-based-routing-with-reverse-proxy-serving-multiple-websites-from-one-domain-3c63"
  },
  "original_language": "en",
  "account": "Hey developers 👋 In our development journey, we've all experimented with domains, subdomains, routes, reverse proxies, and numerous DNS records. However, there's an intriguing issue: what if you'd like a distinct website to display at a particular path of your existing domain? Imagine I have a pastry business called My Pastries 🍰. My principal website is located at mypastries.com, which is built with Next.js for server-side rendering, outstanding performance, robust SEO, and ample flexibility to customize everything. Everything is going smoothly. Then, I decide to establish a blog. Not only is this because everyone constantly says content is king, but also because I wish to publish useful content, establish topical authority, attract organic traffic, and provide the website with additional reasons to exist beyond merely showcasing our cakes. So, I deploy this blog separately. My infrastructure now resembles:\n\n172.1.0.1 → Main Next.js website\n172.1.0.2 → WordPress/CMS blog\n\nBut here's the interesting part. I don't want users to visit blog.mypastries.com; instead, I want them to visit mypastries.com/blog. If they open an article, like mypastries.com/blog/how-to-make-the-perfect-croissant, I want the second server to manage that request. Yet, I still want the browser to display mypastries.com/blog/how-to-make-the-perfect-croissant without any redirects, separate domains, or making users aware of the blog's actual hosting location.\n\nThis is where reverse proxies and path-based routing come into play. Here's how to serve two completely different servers as one website using reverse proxies and path-based routing.",
  "summary": "Hey developers 👋 At some point in our development journey, we’ve all played around with domains, subdomains, routes, reverse proxies, and enough DNS records to make us question our life choices. But here’s an interesting problem: What if you want a completely different website to appear at a specific path of your existing domain? Let's say I have a pastry business called My Pastries 🍰. My main…",
  "key_points": [
    "Serve two websites from one domain with reverse proxy",
    "Path-based routing displays correct URLs without redirects",
    "Blog hosted separately, appears as subpath of main site"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}