最近在学node利用pm2部署上线,然后用nginx做反向代理和负载均衡的功能,本人在试在centos7环境试验的,下面让我来给大家介绍一下部署的步骤吧
1.我们先在虚拟机安装三台centos7的系统,然后在每台系统里面安装nginx,安装nginx的步骤如下:看这篇文章
https://www.jianshu.com/p/e952164e25b0
2.进入nginx的配置文件

3.如果在另外两台服务器部署node


在这里,deploy.js的作用就是写shell脚本的需要安装shelljs

最后结果是


网友评论