Deploy Main and Admin app to the same domain where admin can be used from domain/admin route
Unanswered
Donskoy posted this in #help-forum
DonskoyOP
Hello here,
I am working on nxMonorepo next js project where I have 2 apps using next js,
1. main application
2. admin panel.
I have deployed both application on vercel which is working fine.
but i want to use main app and admin app in single domain like,
main app : www.xyz-vercel.com
admin app: www.xyz-vercel.com/admin using tailwind css
so for that i created another repo and created vercel.json over there, and added below configuration in that vercel.json
it is working when i try to use main application but when I try to redirect to /admin/ it is loading the HTML content but not the css and js files
I am working on nxMonorepo next js project where I have 2 apps using next js,
1. main application
2. admin panel.
I have deployed both application on vercel which is working fine.
but i want to use main app and admin app in single domain like,
main app : www.xyz-vercel.com
admin app: www.xyz-vercel.com/admin using tailwind css
so for that i created another repo and created vercel.json over there, and added below configuration in that vercel.json
{
"rewrites": [
{
"source": "/admin/",
"destination": "https://xyz-admin.vercel.app/"
},
{
"source": "/admin/:match*",
"destination": "https://xyz-admin.app/:match*"
},
{
"source": "/",
"destination": "https://xyz-main.vercel.app/"
},
{
"source": "/:match*",
"destination": "https://xyz-main.vercel.app/:match*"
}
]
}it is working when i try to use main application but when I try to redirect to /admin/ it is loading the HTML content but not the css and js files
1 Reply
DonskoyOP
#help-forum