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