31 lines
690 B
Markdown
31 lines
690 B
Markdown
# 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;
|
||
}
|
||
```
|
||
|
||
#### 依赖安装、运行
|
||
|
||
```bash
|
||
// 依赖
|
||
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 |