一、搭建nginx+node+npm+pm2环境
- 安装nginx,安装步骤省略。
- 安装node,安装步骤省略。
- 安装npm,安装步骤省略。
- 安装pm2,安装步骤省略。
二、配置nginx代理监听3000端口
在edusoho的nginx配置中,加上代理配置:
location ~ ^/$ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
location ~ ^/_nuxt {
proxy_pass http://localhost:3000;