不上傳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