The new generation of Vue2 + NUXT.JS + SEMANTIC UI has a personal blog to support the server rendering.
Demonstration station: blog.kamtao.com
Inis interface document: Inis.cc
Server rendering
Support mobile terminal
Support dark mode, smooth and sharp mode.
Each page is split every page
Only loaded key CSS (page -level)
Custom bottom, etc.
Route smooth switch processing
The project is based on INIS development, and the relevant API requires INIS blessings.
If the INIS blog system is not deployed, please move: https://inis.cn/#/article/1
Install the pagoda panel
A ShH tool that can connect your server
A unremitting heart (important)
First install the PM2 management tool to download it in the Pagoda Software Store. (If it has been installed, ignore this step)
Add site, this self -bound domain name
Then copy the entire NUXT project to the directory binding of the domain name (this directory position is the directory of the previous step)
Then open it, the project file nuxt.config.js, modify the API address to the domain name of your background interface, see the icon.
Use the SSH tool to connect your server, and then enter the directory of your website, such as CD /www /xxx, then execute the command
# cd到网站目录(是你的项目目录)
$ cd /www/xxx
# 安装依赖(请注意 要在你的站点目录下执行,请注意node版本是14)
$ npm install 或者 cnpm install
# 构建你的项目
$ npm run build 或者 nuxt build
# 运行
$ pm2 start
# 测试一下
$ pm2 list
# 如果看到以下的样子 说明成功了
If there is no problem at this time, it will be successful. After that, we will set up an reverse proxy, find the website that has just created, click the settings, find the reverse proxy, and set the specific settings. The specific setting is as shown in the figure.
Special: If your current port has conflicts with the conflict you have set, you can modify the port (ecosystem.config.js in the project file root directory), please pay attention to restart the PM2 after modification. (If the port has no conflict, please ignore it)
# 重启PM2
$ pm2 restart all
If you still cannot be accessed, it may be a port problem. Alibaba Cloud and Tencent Cloud are open in the security group, and the safety group of the pagoda must also be opened.
enjoy it!
In the process of installation and use, if you encounter problems, please ask the author to mention it. QQ communication group: 632274746
Welcome friends to contribute in various forms, including but not limited to: interface, function, improvement, repair bug, etc.