I followed vue tutorial for deploying applications with context path as https://cli.vuejs.org/config/#publicpath I used the vue provided caddy rule since i am using history mode https://router.vuejs.org/guide/essentials/history-mode.html#caddy
I am using caddy for deployments.
But when i use the publicpath ,and i go for a router configuration which has a /path , its giving me 404. It works fine in locally ;but doesnt work on caddy.
Vue.use(Router)
const routes = [
{ path: '/', component: Home },
{ path: '/markabsent/:studentid/:techerid', component: StudentForm, props: true },
{ path: '/markpresent/:studentid/teacher/:techerid', component: StudentReturnForm},
{ path: '*', component: PageNotFound }
]
export default new Router({
mode: 'history',
base: 'univ',
routes
})
I use the default caddy config only as below
0.0.0.0:2015
root /var/www/html
log stdout
errors stdout
rewrite {
regexp .*
to {path} /
}
when i access myapp.com/univ/markpresent/43/343 . , its 404. When i access ,myapp.com/univ/ ,it loads the initial page