Loading

使用nginx部署前端项目dist

使用nginx部署前端项目

部署教程

上传编译好的前端项目dist

nginx配置文件

nginx配置访问根名下的项目名

一个小坑

如果根目录下有多个项目 在配置项目绝对路径的名要改成alias ,不然会报rewrite or internal redirection cycle while internally redirecting to


    location / {
        root   /home/rzk/html;
        index  index.html index.htm index.php;
    }

    location /rzkfast {
        alias   /opt/jar/admin-system-element/dist;
        index index.html index.htm index.jsp index.php;
        try_files $uri $uri/ /index.html;
    }

然后重启nginx

systemctl restart nginx
systemctl start nginx
systemctl stop nginx

查看日志

cat /var/log/nginx/access.log
posted @ 2022-05-31 15:17  Rzk  阅读(1781)  评论(0编辑  收藏  举报