IIS configuration for prerender.io

I am trying to implement Prerender.io in my ASP.NET application. I have completed all the necessary steps, including

1) <meta name="fragment" content="!"> In the Index.html header

2) Configured module

  <httpModules> <add name="Prerender" type="Prerender.io.PrerenderModule, IslamicMatchMakers.Web, Version=1.0.0.0, Culture=neutral" /> </httpModules> 

3) Added custom title

  <httpProtocol> <customHeaders> <add name="X-Prerender-Token" value="XXXX" /> </customHeaders> </httpProtocol> 

4) Certain rewriting rules

 <rewrite> <rules> <!--# Only proxy the request to Prerender if it a request for HTML--> <rule name="Prerender" stopProcessing="true"> <match url="^(?!.*?(\.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))(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_USER_AGENT}" pattern="baiduspider|facebookexternalhit|twitterbot" /> <add input="{QUERY_STRING}" pattern="_escaped_fragment_" ignoreCase="false" /> </conditions> <action type="Rewrite" url="http://service.prerender.io/http://{HTTP_HOST}/{R:1}" /> </rule> <rule name="Html5Mode" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{URL}" pattern="/scripts/" negate="true" /> <add input="{URL}" pattern="/content/" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> 

5) I installed the application request routing module in IIS, in which I included the proxy. Here's what it looks like: ARR

Now after this configuration, when I make a request http: // localhost: 2525? _Escaped_fragment_ =

He just shows me a blank page. I'm not sure what I am missing, can anyone suggest.

+6
source share
1 answer

You will not be able to see anything if you are working on localhost. Prerender.io servers can only access public websites, so you can try pushing your code on a public mid-tier server ... or download our open source server and run it locally to check things out first.

Feel free to email me if you have questions about how things will work out and work! :)

todd@prerender.io

+6
source

Source: https://habr.com/ru/post/981301/


All Articles