I did following steps:
- Installed all neede features to IIS (URLRewrite 2.0, ARR, ...)
- Created default MVC Web Application in VisualStudio
- Added this web app as new site to iis (I can access it by
http://localhost
) - Opened URLRewrite for this site
- Clicked
Add Rule(s)...
- Chose
Reverse Proxy
- Entered
google.com
as server where HTTP requests will be forwareded - Unchecked
Enable SSL Offloading
- 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.