使用nginx部署vue项目一直报错,这个折腾我好几天了,哪位大神知道是什么原因吗?下面是我的nginx配置:server{indexindex.htmlindex.htm;server_name***;root/home/u/depolyfile/deploy;listen80;location/{try_files$uri$uri/@rewrites;}location@rewrites{rewrite^(.+)$/index.htmllast;}location~*\.(?:ico|css|js|gif|jpe?g|png)${expiresmax;add_headerPragmapublic;add_headerCache-Control"public,must-revalidate,proxy-revalidate";}}vue的router部分:importVuefrom'vue'importRouterfrom'vue-router'importHelloWorldfrom'@/components/HelloWorld'importDefaultPagefrom'@/components/DefaultPage'Vue.use(Router)exportdefaultnewRouter({mode:'history',routes:[{path:'/',name:'HelloWorld',component:HelloWorld},{path:'*',name:'DefaultPage',component:DefaultPage}]})nginx错误信息:2018/07/0214:26:01[error]5#5:*25rewriteorinternalredirectioncyclewhileredirecttonamedlocation"@rewrites"
添加回答
举报
0/150
提交
取消