Vue项目部署Nginx后,刷新页面出现404问题

在Nginx配置文件nginx.conf中加入如下配置。(index.html根据实际页面配置)
增加:try_files $uri $uri/ /index.html; #解决页面刷新404问题
server {        listen       8080;
        server_name  localhost;
        location / {
            root  D:\vipsoft\dist;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html; #解决页面刷新404问题
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        } 
    } 
以上是 Vue项目部署Nginx后,刷新页面出现404问题 的全部内容, 来源链接: utcz.com/z/377793.html




