Using Prerender.io with Ingress | Kubernetes

ben sassi mohammed
2 min readNov 29, 2020

Search engines and social networks are still crawling your pages, but they only see javascript tags … Prerender interprets your javascript in a browser, saves static HTML code, and returns it to bots.

Prerender.io is an online service that allows you to ensure that your website designed with AngularJS, BackBones.JS, Ember or jQuery is perfectly crawled by Google Bots, Bing as well as all other search engines.

Google is currently the only search engine capable of executing the JavaScript code of a website. On the other hand, we often notice that the crawling is not perfect and that these sites are deprecated in the search results. In order to guarantee excellent SEO it is preferable to use Prerender.io in order to achieve better performance.

How does Prerender work?

The Prerender.io middleware that you install on your server checks each request to see if it is a request from a robot. If so, the middleware sends a request to Prerender.io to see the static HTML for that page. Otherwise, the request will continue as normal on your server. The robot never knows that you are using Prerender.io since the response always goes through your server.

Publisher: Prerender.io

You do not need to configure an Endpoints resource as with an external IP address. Create an Ingress for this Service:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: prerender-ingress
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: >
proxy_set_header X-Prerender-Token xxxxxxx;
set $prerender 0;
if ($http_user_agent ~*
"googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quoralinkpreview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp")
{
set $prerender 1;
}

if ($args ~ "_escaped_fragment_") {
set $prerender 1;
}
if ( $prerender = 1 ) {proxy_pass https://service.prerender.io/$scheme://$host$request_uri?;

}

spec:
rules:
- host: www.example.com
http:
paths:
- backend:
serviceName: example-service
servicePort: 80

--

--

ben sassi mohammed

Architecte API , Microservices , javascript , java , Angular, kubernetes