首页 > 其他 > 详细

使用vue-router 刷新 404错误

时间:2016-12-24 16:46:27      阅读:736      评论:0      收藏:0      [点我收藏+]

修改nginx.conf

server {
        listen       80;
        server_name  demongao.com www.demongao.com;
        root         /demongao/vueblog/dist;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
             try_files $uri $uri/ @router;
             index index.html;
         }

        location @router {
            rewrite ^.*$ /index.html last;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

 

使用vue-router 刷新 404错误

原文:http://www.cnblogs.com/demongao/p/6217506.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!