Go to file
黄心宇 b15bf23a8e cont. 2023-09-27 17:46:25 +08:00
redis test 2023-09-27 12:38:28 +08:00
.gitignore test 2023-09-27 12:38:28 +08:00
README.md test 2023-09-27 12:38:28 +08:00
config.js cont. 2023-09-27 17:46:25 +08:00
index.js cont. 2023-09-27 17:05:26 +08:00
package-lock.json test 2023-09-27 12:38:28 +08:00
package.json test 2023-09-27 12:38:28 +08:00
puppeteerTool.js cont. 2023-09-27 17:05:26 +08:00
ssr.js test 2023-09-27 17:26:10 +08:00

README.md

SeoServer

node版本

16及以上

ng配置

if ($http_user_agent ~* "googlebot|Mediapartners-Google|bingbot|google-structured-data-testing-tool|baiduspider|360Spider|Sogou Spider|Yahoo! Slurp China|^$")
  {#判断如果是网络爬虫转发到node服务器下
      proxy_pass http://www.test.com:3000;
      break;
  }

依赖安装、运行

// 依赖
npm install
npm install pm2 -g
node node_modules/puppeteer/install.js // 安装无头浏览器可能会缺依赖可参见https://www.cnblogs.com/ilizhu/p/14504049.html

// 启动服务
pm2 start index.js

配置

config中修改redis地址端口、node服务端口、以及转发host