查看服务器环境
lsb_release -a
系统配置
df -h
连接远程服务器,接下来我参考了阮一峰老师的这篇文章
配置参考这篇文章吧,我就跳过了。
安装npm node
下载node
sudo apt-get install nodejs
sudo apt-get install npm
更新node
sudo npm install n -g
sudo n stable
cd /usr/local/openresty/nginx/conf
cat nginx.conf
npm install pm2 -g
pm2 start index.js
vim /usr/local/openresty/nginx/conf/nginx.conf
i
###wuziqi
location / {
proxy_pass http://127.0.0.1:3000;
proxy_redirect default ;
}
esc
:wq