nginx配置:
location /prerender {
access_log /var/log/nginx/prerender.log main;
rewrite ^/prerender/(.*)$ /render?url=$1 break;
proxy_pass http://127.0.0.1:3010;
}
nginx日志中看到的请求记录:
10.52.32.58 - - [21/Dec/2020:13:38:09 +0800] "GET /prerender/http://manhua-test.iqiyi.com/comic/index HTTP/1.0" 200 19254 "-" "Googlebot" "-"
node服务器中打印出来的请求路径为
/render?url=http:/manhua-test.iqiyi.com/comic/index
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…