配置
fork nextjs-notion-starter-kit,Clone 代码到本地,按照其 README 的说明配置相关信息
这里可参考用Notion搭建自己的网站
npm install npm run dev
npm install -g pm2
pm2 start npm --name mysite -- run start # --name 后面可以修改为你喜欢的名字
pm2 logs mysite
pm2 l
nginx reload mysite
apt install nginx -y
/etc/nginx/site-enables
创建配置文件 yourdomian.confserver { listen 80; listen [::]:80; server_name yourdomain.com; server_name www.yourdomain.com; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/nginx/ssl/youdomian.com/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/youdomian.com/key.pem; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; }
server_name
后面的 domain 为你的域名,为你的域名申请证书并放到指定目录下,配置正确的 ssl_certificate
和 ssl_certificate_key
,配置完成后,检验nginx 配置nginx -t
nginx -s reload
npm install -g pm2
npm run build
npm run start
pm2 start npm --name mysite -- run start # --name 后面可以修改为你喜欢的名字