我的服务器
- 域名: casssb.com、lcong.cn
- 公网 ID: 120.27.128.641
CPU&内存: 1 核(vCPU)2 GiB
操作系统:CentOS 7.2 64 位
我的 node 服务
进入文件:
cd /www/wwwroot/www.lcong.cn/node-server
1
cd /www/wwwroot/api.casssb.com/node-server/
1
pm2 启动:
pm2 start ./bootstrap.js --name node
1
api.casssb.com
- 项目练习 Node 服务文件夹地址:
/www/wwwroot/api.casssb.com/project/
vscode sftp
{
"name": "node",
"host": "120.27.128.641",
"protocol": "sftp",
"port": 22,
"username": "root",
"password": "********",
"remotePath": "/www/wwwroot/api.casssb.com/",
"uploadOnSave": true,
"ignore": ["/.github", "/.vscode", "/node_modules"]
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Sync Local -> Remote
: 同步本地到远程Sync Remote -> Local
: 同步远程到本地Sync Both Directions
: 同时同步本地和远程
宝塔面板
地址: http://120.27.128.641:8888/115a30bf/open in new window
nginx 配置
有个总的 nginx 配置,文件路径: /www/server/nginx/conf/nginx.conf
,里面有个include
引入所有站点单独的 nginx 配置。
宝塔面板中每个站点都有一个 nginx 配置,文件路径: www/server/panel/vhost/nginx/
,可以对每个站点单独配置。
宝塔 ssh 命令操作 nginx
启动:
/etc/init.d/nginx start
停止:
/etc/init.d/nginx stop
重启:
/etc/init.d/nginx restart
启载:
/etc/init.d/nginx reload
接口跨域
试着在casssb.com
中也配置代理,代理到api.casssb.com
中。