0
点赞
收藏
分享

微信扫一扫

使用nginx部署前端项目dist

sin信仰 2022-06-28 阅读 67

使用nginx部署前端项目

​​部署教程​​

上传编译好的前端项目dist

nginx配置文件

使用nginx部署前端项目dist_html


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


举报

相关推荐

0 条评论