Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web_doc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web
web_doc
Commits
66dc6f8d
Commit
66dc6f8d
authored
Apr 22, 2021
by
刘美琴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nuxt部署
parent
8656ffdd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
nuxt部署流程.md
+55
-0
No files found.
nuxt部署流程.md
0 → 100644
View file @
66dc6f8d
# 1、node环境准备
# 1、node环境准备
cd /opt
# 1)、node安装包下载,下载地址:https://nodejs.org/zh-cn/download/
wget -c https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz
# 2)、node安装
tar xf node-v12.18.3-linux-x64.tar.xz
# 3)、node环境变量配置
cat >>/etc/profile <<-'END'
export PATH=$PATH:/opt/node-v12.18.3-linux-x64/bin
END
source /etc/profile
# 2、项目环境准备
# 1)、拷贝完整项目到服务器文件下
cd /data0/wwwroot/
#上传项目文件
# 2)、进入项目目录,安装依赖
`npm i`
cd /data0/wwwrooo/XXX
npm install
# 3)、打包:
`npm run build`
npm run build
# 4)、启动:
`npm run start`
npm run start
# 以守护进程的方式运行
# 5)、安装pm2,
`npm install pm2 -g`
npm install pm2 -g
# 6)、pm2启动项目:
` pm2 start ./node_modules/nuxt/bin/nuxt -- start`
pm2 start ./node_modules/nuxt/bin/nuxt -- start
# 3、准备nginx配置文件
server {
server_name www.wecloud.cn;
listen 80;
location / {
proxy_intercept_errors on;
error_page 404 =404 /404.html;
index index.html index.htm index.php;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000; #后端服务器,具体配置upstream部分即可
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment