好久没发贴了,水一贴,权当笔记
项目地址 https://github.com/zmh-program/next-whois-ui
----------------------------------------------------------------------------------------------
cd /home && git clone https://github.com/zmh-program/next-whois-ui
cd next-whois-ui && apt install npm -y
npm install -g pnpm
pnpm dev
vi /home/next-whois-ui/ecosystem.config.js
module.exports = { apps: [ { name: "next-whois-ui", cwd: "/home/next-whois-ui", script: "node_modules/next/dist/bin/next", args: "start -p 3000 -H 127.0.0.1", env: { NODE_ENV: "production" } } ] };
vi /etc/nginx/conf.d/who.conf
server { listen 80; server_name 你的域名; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
启动pm2和nginx
pm2 start ecosystem.config.js
nginx -t && nginx -s reload
最终效果图
可能遇到的问题和坑点
nodejs低版本报错
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc nvm install 18 nvm use 18 nvm alias default 18
服务器不支持以IPV6连接到npm仓库
sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 npm install -g pnpm