prerender.io IIS configuration

你说的曾经没有我的故事 提交于 2019-12-23 09:15:37

问题


I am trying to implement Prerender.io in my ASP.NET application. I configured all the required necessary steps including

1)<meta name="fragment" content="!"> in head of Index.html

2) Configured the Module

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

3) Added Custom Header

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

4) Defined Rewrite rules

<rewrite>
      <rules>

        <!--# Only proxy the request to Prerender if it's 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 on IIS, in which I enable the Proxy. Here is the image how it looks like: ARR

Now after all these configuration when I make a request to http://localhost:2525?_escaped_fragment_=

It just show me a blank page. I am not sure what I am missing, can anyone please suggest.


回答1:


You won't be able to see anything if you're running on localhost. The Prerender.io servers can only access publicly available websites, so you could try pushing your code to a public staging server...or download our open source server and run it locally to test things first.

Feel free to email me if you have any more questions about getting things up and running! :)

todd@prerender.io



来源:https://stackoverflow.com/questions/28051510/prerender-io-iis-configuration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!