vue-router模式为history的项目打包发布后不能通过地址栏里的地址进行路由跳转

修改nginx的配置文件

server {
        listen       8080;
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
            try_files $uri $uri/ /index.html;#必须要有的
            root   /home/dist/;#打包后的项目路径,index.html所在文件夹
            index  index.html index.htm;
        }
}

 

posted @ 2022-01-04 17:10  世界因你而小  阅读(420)  评论(0编辑  收藏  举报