nginx 部署vue

server {
        listen       80;
        server_name  localhost;
        root        /www/meiduo_admin/dist;

       access_log   /var/log/nginx/admin_access.log;
       error_log    /var/log/nginx/admin_error.log;

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

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

 

posted @ 2021-05-14 14:13  LiShiChao  阅读(52)  评论(0编辑  收藏  举报