Answer the question
In order to leave comments, you need to log in
How to implement two react applications on the same domain?
There is a server with Nginx. There is one domain. There are two react applications (showcase and admin). What is the best way to host them on the same domain?
I would like people to go to the online store on site.com/, and on site.com/admin the administrator could go to the admin panel. I tried using the location in the nginx settings, but it doesn’t even work, I can’t find the right configuration.
As an option, I thought to make an admin panel on the admin.site.com subdomain, but this is an ugly solution (two folders in the directory with the rest of the sites).
Answer the question
In order to leave comments, you need to log in
In the react itself, everything is clear, if your /admin path is not described in the route, then the link to it will work like a regular link and pull the page from the server
. In nginx, the /admin location must be located higher than the location for the entire application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question