1

I am setting up different web applications on a Win 2008 R2 server. I am trying to accomplish the following:

  1. http://myserver/ should point to a local folder with static html pages

  2. http://myserver/crm should "rewrite" to http://myserver:1234/ where I have installed a web based CRM application.

We have a change process to open firewall ports so instead of getting them to open the 1234 port, I would rather have people just go via http://myserver/crm and IIS should hide the port business behind scenes.

  1. Do I need a reverse proxy in this case? Or a simple inbound rule?
  2. At which website should I configure this rule?
  3. Do I need to create a "CRM" virtual directory under default website?
  4. Also, any rule example would help.
  5. I hope this will accomplish the objective of not needing to open ports in firewall...?

Thanks (Sorry if this is similar to another question, but I wasn't sure if I need a reverse proxy or a simple inbound rule.)

Raza Ali
  • 595
  • 1
  • 13
  • 29

1 Answers1

1
  1. You need inbound and outbound rule. The method to achieve this goal is called reverse proxy.
  2. On the level of Website handling http://myserver/ domain or Global level.
  3. No.
  4. Use the rules below as a starting point.
  5. I would say it's possible to achieve your goal using reverse proxy.

IIS Rewrite Rules:

<rules>
    <rule name="CrmInbound">
        <match url="^crm(.*)" />
        <action type="Rewrite" url="http://myserver:1234/{R:1}" />
    </rule>
</rules>
<outboundRules>
    <rule name="CrmOutbound" preCondition="OnlyHtml">
        <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="http://myserver:1234(.*)" />
        <action type="Rewrite" value="http://myserver/crm(.*)" />
    </rule>
    <preConditions>
        <preCondition name="OnlyHtml">
            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
        </preCondition>
    </preConditions>
</outboundRules>
Tomek
  • 3,267
  • 2
  • 22
  • 23
  • Thanks. I think we are close. Getting internal server error though on both http://myserver/ and http://myserver/crm/. Will dig into tracing to see what's happening. – Raza Ali Mar 06 '12 at 11:16
  • Ok, so I disabled the outbound piece and at least the internal server error is gone. I can see the main myserver site correctly and it navigates to myserver/crm but shows a blank page, both locally and on the network. Probably need to tweak the outbound somehow. – Raza Ali Mar 06 '12 at 11:56
  • A small update: I tried applying a simple rule that rewrites myserver to myserver:1234, and it works fine. But I am trying to rewrite myserver/crm to myserver:1234 which is resulting in HTTP500 when I put in the outbound rule. – Raza Ali Mar 08 '12 at 07:42
  • To sort of close this topic, as the issue is still unresolved, it seems that all I need is an inbound rule, not an outbound. So with an inbound rule, the next issue I am facing is that the page appears blank but no errors. I checked failed request logs and RequestURL is blank for child pages. I will now open another post in stackoverflow for this issue. – Raza Ali Mar 22 '12 at 07:51