3

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.

1
  • Did you ever manage to get this to work? Im guessing even if you did, the solution is so illogical you possibly dont remember how it was achieved :D Im having the same issue and tearing my hair out...
    – Jimbo
    Feb 17, 2020 at 12:30

0

You must log in to answer this question.

Browse other questions tagged .