-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple apps on same domain, on different hosts #9266
Comments
Based on your explanation With regards to having a basepath that's already tracked in #4998. |
I even describe how assetPrefix and zones are not working in this case. Thanks for the hint at #4998 though, that would solve my problem. |
Based on what you're describing they would work. I guess you're making assumptions about the url being a certain shape though hence why you want basepath. |
I handled this issue via Nginx Routing. What i assumed while making this Nginx Routing is that every file will have unique hash and file name combination. This is the snippet of code of Nginx Routing which i used.
What the above code does is, whenever Nginx encounters /_next/ it will first try that URL with @server1, if that Server responds with 404, the Nginx then transfers the request to @server2 as mentioned in error_page param. This example works like: This worked for me as i had 2 apps which were developed on Next and both has _next route. Let me know if this solves your problem. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Is your feature request related to a problem? Please describe.
I want to have
example.org/docs
on host1 andexample.org/docs
on host2.That means there would be a reverse proxy that would split traffic depending on the path and direct it to either host1 or host2. This is currently not possible with next.js, because both apps will produce _/next/static folders that the upstream reverse proxy can not tell apart.
Describe the solution you'd like
Ideally next.js would have strong support for a "basepath"-like solution so that all site-internal links, all assets and all files from _/next/static would get adjusted. Maybe even just a "chunksPath" because everything but the _/next/static folder can be solved.
Describe alternatives you've considered
assetPrefix
configuration but when for example set to/docs
the server issues requests for/docs/_next/static/...
which all go 404Additional context
I found similar requests in #5602 and #257.
The text was updated successfully, but these errors were encountered: