2

I did following steps:

  1. Installed all neede features to IIS (URLRewrite 2.0, ARR, ...)
  2. Created default MVC Web Application in VisualStudio
  3. Added this web app as new site to iis (I can access it by http://localhost)
  4. Opened URLRewrite for this site
  5. Clicked Add Rule(s)...
  6. Chose Reverse Proxy
  7. Entered google.com as server where HTTP requests will be forwareded
  8. Unchecked Enable SSL Offloading
  9. Clicked OK

When I access http://localhost I still have my own webapp, not google.com. In my web.config I have:

<rewrite>
    <rules>
        <rule name="ReverseProxyInboundRule1" stopProcessing="true">
            <match url="(.*)" />
            <conditions>
                <add input="{CACHE_URL}" pattern="^(https?)://" />
            </conditions>
            <action type="Rewrite" url="{C:1}://google.com/{R:1}" />
        </rule>
    </rules>
</rewrite>

Then I tried to add more usefull rule: rewriting localhost/google/sth to google.com/search?q=sth. I changed web.config:

<rewrite>
    <rules>
        <rule name="ReverseProxyInboundRule1" stopProcessing="true">
            <match url="^google/(.*)" />
            <conditions>
                <add input="{CACHE_URL}" pattern="^(https?)://" />
            </conditions>
            <action type="Rewrite" url="{C:1}://google.com/search?q={R:1}" />
        </rule>
    </rules>
</rewrite>

And it still doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.