fxxqq / 6fedcom.github.io

frank的前端养成记(hexo博客)
https://6fed.com
22 stars 5 forks source link

vue项目在nginx中部署 #75

Open fxxqq opened 6 years ago

fxxqq commented 6 years ago

nginx的配置文件: 添加如下server

server {
    listen 7070;
    server_name localhost;

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

        root /data / xytest / project / zkview - ui / dist;
    index index.html;

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

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

添加完成后热加载nginx

nginx - s reload