Rewrites based on subdomain #29831
TheRusskiy
started this conversation in
Ideas
Replies: 4 comments 2 replies
-
Hi, can this not already be achieved using |
Beta Was this translation helpful? Give feedback.
1 reply
-
I solved it with the following code
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I've done it using the |
Beta Was this translation helpful? Give feedback.
1 reply
-
below is my code
but even if i loads admin.localhost:3000 my FE end shows main app page |
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
-
Describe the feature you'd like to request
Right now Next.js is lacking support for routing based on subdomains.
E.g. we want to have dynamic subdomains for different companies/customers.
company1.example.com
company2.example.com
/
path for these URLs should return different results.Describe the solution you'd like
One solution that Next.js could do is to implement subdomain matching in rewrites:
https://nextjs.org/docs/api-reference/next.config.js/rewrites
It could be something like
Describe alternatives you've considered
The only alternative I can think of is placing everything behind Nginx and doing a bunch of rewrites manually.
Beta Was this translation helpful? Give feedback.
All reactions