Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How can I use host http://192.168.2.27 but my back end will display http://192.168.2.21?

Sample:
When i type www.google.comin my browser, I want it to go to wwww.yahoo.com but the url address will not display the www.yahoo.com. I think I can manipulate it in ii7 but I don't know how to do it.

I'm using windows server 2008.

share|improve this question
1  
this is not possible with iis –  cept0 Nov 17 '11 at 10:18
    
so if is not possible on iis where can i do this –  meloi Nov 17 '11 at 10:52
    
try Nginx for Windows and configure your host with the integrated HttpProxyModule –  cept0 Nov 17 '11 at 11:14
    
huhuhu complicated is there any other sugesstion –  meloi Nov 17 '11 at 11:42
    
daily processing ;-) –  cept0 Nov 17 '11 at 11:43

2 Answers 2

The other solutions are technically better than my suggestion. They're more complex too. If this is something which doesn't have to be very 'clean' then a way to do this would be to redirect www.google.com, using your internal dns server, to your internal web server. In IIS you create a site which responds to www.google.com. On this site you create a default page which has a single iframe which fills the page and contains www.yahoo.com.

Its not elegant but it would work. It all depends on how resilient it has to be and how it has to appear. Lots of things would not work - like opening links in another window.

share|improve this answer

You have to install the Application Request Routing ARR module which allows IIS to acts as a reverse proxy server. The module is available for free from Microsoft and will allow you to do exactly what you want.

UPDATE: It's really straight forward to set up. For more information see this blog post on MSDN. For you scenario you basically set up an empty website on 192.168.2.27 with just a web.config that will take care of setting up the proxy rules. The content of this web.config will be (or similar) like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Reverse Proxy Inbound Rule" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="^(https?)://" />
                    </conditions>
                    <action type="Rewrite" url="{C:1}://192.168.2.27/{R:1}" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="Reverse Proxy Outbound Rule" preCondition="ResponseIsHTML">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://192.168.2.21/(.*)" />
                    <action type="Rewrite" value="http{R:1}://192.168.2.27/{R:2}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHTML">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
        <urlCompression doStaticCompression="false" doDynamicCompression="false" />
    </system.webServer>
</configuration>

For this to work you must of course enable the 'Enable proxy' checkbox in the 'Application Request Routing Cache' module. This module can only be configured at the server root level (i.e. the node with the name of you server in IIS Manager).

Also make sure that the response of http://192.168.2.21 is not gzip compressed otherwise the URLRewrite module will not be able to rewrite the links in the response.

share|improve this answer
    
bro do you have any procedure on doing this –  meloi Nov 17 '11 at 12:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.