npm run build  复制这四个文件到nginx/html/项目名称 下   安装nodejs,并进入目录下载依赖
npm install
启动与访问项目 npm run start 开启另一个窗口使用 curl http://localhost:3000 如果有html代码返回则无问题 ctrl+c结束项目运行 后台启动项目 nohup npm run start & 配置nginx代理
server {
listen 80;
server_name blog.mengxuegu.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:$server_port;
proxy_pass http://127.0.0.1:3000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
刷新配置 cd /usr/local/nginx/sbin ./nginx -s reload
|