nuxt 部署笔记

Node版本

node版本在v8运行失败,v12正常运行,先升级node版本至12后在进行安装npm install

pm2 后台启动

npm install -g pm2

pm2 start npm -- run start

查看PM2列表

pm2 list

停止进程

pm2 stop 上面list中的id

Nginx 配置

参考教程

nginx 配置示例

upstream nuxt {
  server 127.0.0.1:3000;
}

server {
    listen 8888; #服务器端口80
    server_name instruction;  #这里对应你服务器的域名
    access_log /var/log/nginx/instruction.log;
    error_log /var/log/nginx/instruction.log;
    location / {
        proxy_pass http://nuxt;  #这里对应上面upstream中新建的服务名
        index index.html index.htm;
    }
}

修改配置后,使用nginx -t进行配置测试,测试成功后使用nginx -s reload进行配置加载生效。

posted @ 2020-07-10 15:44  冬天之歌  阅读(171)  评论(0编辑  收藏  举报