URL Rewrite to same server on different ports [Answered]RSS

1 reply

Last post Sep 14, 2016 10:05 AM by Yuk Ding

  • URL Rewrite to same server on different ports

    Sep 13, 2016 07:52 AM|Bowlen|LINK

    Hi Everyone,

    I currently have IIS using a Server Farm and ARR to forward traffic from gis.domain.com to my specific server.  This part is working fine.  What I'd like to have setup, is to have gis.domain.com/webapp to forward to the same server, but on a different port.

    So if default port was 80 and gis.domain.com goes there, then gis.domain.com/webapp would go to <servername>:8080.  I managed to get this working with URL Rewrite on the default website in a test lab, but I wasn't using the server farm, and wasn't using multiple servers (IE Server Farm IIS forwarding to the Node where the website is stored).

    I can't quite get this one to work.  Any help would be greatly appreciated.

  • Re: URL Rewrite to same server on different ports

    Sep 14, 2016 10:05 AM|Yuk Ding|LINK

    Hi Bowlen,

    You could add the following script to server farm URL rewrite rules:           

        <rule name="newrewrite rule">

                        <match url="(.*)" />

                        <conditions>

                            <add input="{HTTP_HOST}" pattern="gis.domain.com" />

                            <add input="{REQUEST_URI}" pattern="webapp" />

                        </conditions>

                        <action type="Rewrite" url="http://<servername>:8080/webapp" />

                    </rule>

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.