不上传node_modules
文件夹,上传项目后,再cnpm install
node
配置nginx.confnginx
server{ listen 80; server_name blog.pengyongjie.top; location / { proxy_pass http://127.0.0.1:8001; } }
先中止项目和nginxnpm
npm stop killall nginx
先启动项目服务器
npm start
再启动nginxurl
nginx
http://119.29.93.144:8001/news
spa
前面加#注释掉项目二的servercode
端口号为8002,因此命名8002server
server{ listen 80; server_name shop.pengyongjie.top; location / { proxy_pass http://127.0.0.1:8002; } }
shop.pengyongjie.topblog
在域名解析,加上二级域名ip