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 @   世界因你而小  阅读(432)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示