IIS 7 URL Rewrite or Reverse Proxy to Handle Firewall Security

IIS 7 URL Rewrite or Reverse Proxy to Handle Firewall Security

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

http://myserver/ should point to a local folder with static html pages
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.

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

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


Solution 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:

    <rule name="CrmInbound">
        <match url="^crm(.*)" />
        <action type="Rewrite" url="http://myserver:1234/{R:1}" />
    <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(.*)" />
        <preCondition name="OnlyHtml">
            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />