Replies: 1 comment
-
Serve multiple domains on one app --> Use domain-based routing or basePath via rewrites |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Need to run a single Next.js application across multiple domains with different basePaths, but assets are not loading correctly due to incorrect asset paths that don't include the required basePath segment.
Current Setup
Project structure: app/[locale]/[basePath]/page.tsx
Target domains:
Requirements: Single Next.js app serving multiple domains with dynamic data fetching based on domain
Problem Description
Current Issue
When deploying the Next.js application to production domains, assets fail to load because:
Current Project Structure
Where:
Considered Solutions
Option 1: Using Next.js basePath config
Implementation: Set basePath in next.config.js for each domain
Required changes:
Concerns with Option 1
Maintainability: Managing 14+ separate Next.js applications (with more being added)
Debugging complexity: Difficult to identify which instance is causing build errors
Scaling issues: Adding new domains requires new deployments and configurations
Questions
Expected Behavior
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions