You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-5Lines changed: 32 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,24 @@
1
-
## Prender Proxy - React Js App
1
+
## React Server Side Rendering with Puppeteer if googlebot, yahoobot detected.
2
2
React JS Client > Cloudflare > Proxy Server (Pupeeter)
3
3
4
+
This script is intend to render the react server side but using Pre-Rendering technique and it will prerender only if it detects the googlebot, yahoobot or bing.
5
+
Before we used to have React SSR on server side but as our code grows the issues also started to grow which made me rethink to alternative strategy to render the APP server side as i needed the SSR only for SEO so google and other search engines can crawl my site and have good SEO ranking. So here's the solution.
6
+
7
+
#### Required Skills
8
+
* You know how to configure Nginx
9
+
* You have knowledge how to host node.js app using NGINX
10
+
4
11
#### Few points to remeber
5
12
* Proxy will not work if you are trying to achieve this (You want requests to go from the browser via **Cloudflare’s proxy** to your **Nginx proxy** and then on to your **internal server**.)
6
13
* You need to disable the proxy cloud on cloudflare for your Proxy A Records for e.g. in my case it was A - prerender.lucian.com - 11.22.33.343 (Proxy Icon Disabled)
7
14
15
+
#### Use Case
16
+
* We have 2 servers SERVER A and SERVER B
17
+
* SERVER A hosts the React JS app as plain HTML
18
+
* SERVER B will be the proxy server
19
+
8
20
## STEPS
9
-
* Create a prerender.lucian.com.conf in nginx > sites-avaiable
21
+
* Create a NGINX conf file /etc/nginx/sites-available/prerender.lucian.com.conf
0 commit comments