Last active
February 4, 2022 18:05
-
Star
(137)
You must be signed in to star a gist -
Fork
(37)
You must be signed in to fork a gist
-
-
Save Stanback/6998085 to your computer and use it in GitHub Desktop.
Revisions
-
Brian Stanback revised this gist
Nov 3, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ # Note (November 2016): # This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information # Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol server { listen 80; listen [::]:80; -
Stanback revised this gist
Jan 8, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ server { } if ($prerender = 1) { rewrite .* /$scheme://$host$request_uri? break; #proxy_pass http://localhost:3000; proxy_pass http://service.prerender.io; } -
Stanback revised this gist
Jan 7, 2014 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,9 +29,6 @@ server { if ($http_user_agent ~ "Prerender") { set $prerender 0; } if ($prerender = 1) { rewrite .* /$scheme://$host$request_uri break; -
Stanback revised this gist
Jan 3, 2014 . 1 changed file with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,10 +17,7 @@ server { } location @prerender { #proxy_set_header X-Prerender-Token YOUR_TOKEN; set $prerender 0; if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") { @@ -39,7 +36,7 @@ server { if ($prerender = 1) { rewrite .* /$scheme://$host$request_uri break; #proxy_pass http://localhost:3000; proxy_pass http://service.prerender.io; } if ($prerender = 0) { rewrite .* /index.html break; -
Stanback revised this gist
Jan 3, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,6 +32,9 @@ server { 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") { set $prerender 0; } if ($prerender = 1) { rewrite .* /$scheme://$host$request_uri break; -
Stanback revised this gist
Oct 29, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ server { if ($args ~ "_escaped_fragment_|prerender=1") { set $prerender 1; } if ($http_user_agent ~ "Prerender") { set $prerender 0; } -
Stanback revised this gist
Oct 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ server { if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") { set $prerender 1; } if ($args ~ "_escaped_fragment_|prerender=1") { set $prerender 1; } if ($http_user_agent ~ "PhantomJS") { -
Stanback created this gist
Oct 15, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ server { listen 80; listen [::]:80; server_name yourserver.com; root /path/to/your/htdocs; error_page 404 /404.html index index.html; location ~ /\. { deny all; } location / { try_files $uri @prerender; } location @prerender { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_intercept_errors on; set $prerender 0; if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") { set $prerender 1; } if ($args ~ "_escaped_fragment_=|prerender=1") { set $prerender 1; } if ($http_user_agent ~ "PhantomJS") { set $prerender 0; } if ($prerender = 1) { rewrite .* /$scheme://$host$request_uri break; #proxy_pass http://localhost:3000; proxy_pass http://prerender.herokuapp.com; } if ($prerender = 0) { rewrite .* /index.html break; } } }