vue项目在nginx中不能刷新问题


修改nginx配置文件为

server {
    listen 80;
    server_name www.vue.com;
    root html/xxx/dist/;

    client_max_body_size  500m;
    #图片路径拦截,定位到图片静态资源
    location / {
        try_files $uri $uri/ @router;
        index  index.html index.htm index.php;
    }

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

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM