I
I
Ivan2020-02-06 10:20:13
Nginx
Ivan, 2020-02-06 10:20:13

Prerender falls off by timeout, how to solve the problem?

A very old host that uses prerender for seo and everything related to it.
This code is used in nginxe

location @prerender {
                set $prerender 0;
                if ($http_user_agent ~* "XING-contenttabreceiver|whatsapp|discord|googlebot|redditbot|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") {
                        set $prerender 1;
                }
                if ($http_user_agent ~ "Prerender") {
                        set $prerender 0;
                }
                if ($uri ~* "\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|svg|eot)") {
                        set $prerender 0;
                }

                resolver 8.8.8.8;

                if ($prerender = 1) {

                        set $prerender "prerender.host.com";
                        rewrite .* /render?url=https://$host$request_uri break;
                        proxy_pass http://$prerender;
                }
                if ($prerender = 0) {
                        rewrite .* /index.html break;
                }
        }

After that, on the prerender.host.com host, there is nginx, which proxies to the node.
Which I took from the official repository https://github.com/prerender/prerender
The error is this, the request flies by timeout
2020-02-06T07:19:08.059Z getting https://hostname/user/nicolasaintmarc
2020-02-06T07:19:28.119Z page timed out https://hostname/user/nicolasaintmarc
2020-02-06T07:19:28.129Z got 200 in 20070ms for https://hostname/user/nicolasaintmarc
2020-02-06T07:19:28.496Z getting https://hostname/user/ehrin-ehrinmacksey-com

How to solve the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question