I have a nuxt app deployed as the main website reverse proxied with nginx. The settings look as below
location / {
    proxy_pass http://127.0.0.1:3000;
}
Now I have another vue app on same server that I want to run on a subpath e.g. https://www.app.com/dashboard
Below is my settings for nginx and vue router
location ^~ /dashboard {
    alias /srv/www/dashboard-app/dist;
    try_files $uri $uri/ /srv/www/dashboard-app/dist/index.html;
}
const router = createRouter({
  history: createWebHistory('/dashboard'),
  routes,
})
I am able to load my main dashboard when I visit /dashboard and the vue app renders fine.
However if I visit a subpath e.g. /dashboard/team it seems nginx isn't matching my dashboard path and it passes the request to nuxt application which is on / (root) which in returns throws a 404 as there's path that matches /dashboard/team in my nuxt app