I need an advice, how to solve this:
I have two websites example1.com and example2.com
They both made on NuxtJS and works well.
For them I am using Nginx.
I need to do this:
If I going to address example2.com/custompage I need to show page and static files from example1.com/custompage (I am not need redirect on this page, I need to show this page exactly on example2.com/custompage), but when I going to any other page of example2.com I need to keep all pages and files from example2.com
Is it possible to do this with Nginx?
2
Answers
You can use
proxy_pass
. First, run NuxtJS apps in two ports like3000
and3001
then use proxy pass and upstream to do thatAfter following the steps mentioned above.
In your Nuxt Project(nuxt1), you need to add the following to your nuxt.config.js file,
Also, note if you are using any files from the
Static
folder, example an image , example.png.You have to use them like
And
NOT
,If you are using dynamic variable, add an variable in .env , for the router.base