Adding pools/sites for application with server farmRSS

2 replies

Last post Feb 13, 2020 05:29 PM by Rovastar

  • Adding pools/sites for application with server farm

    Feb 12, 2020 12:49 PM|Ady.S|LINK

    Hi,


    I have an application which is running through server farm and I'm trying to find the simplest way how to add other application pools/sites for this application.

    Details:
    - I have two servers - Server1 and Server2
    - The application is running on Server2 on IIS 10
    - Server1 receives requests and directs them based on a rewrite rule to the server farm which is on the Server1

    The rewrite rule:

    <rule name="rule1" enabled="true" stopProcessing="true">
    <match url="^(application)(/.*)?$" />
    <action type="Rewrite" url="http://SERVER_FARM/{R:1}{R:2}" />
    </rule>

    - Server farm directs the requests from Server1 to Server2 where is running the site with application


    It works fine this way, but with one application pool/site only. I want everything to work the same way, but with more pools/sites on the Server2. How to add other pools/sites for this application?

    Thanks in advance.

    AS

  • Re: Adding pools/sites for application with server farm

    Feb 13, 2020 06:14 AM|Jalpa Panchal|LINK

    Hi,

    You could use a rule like:

    <system.webServer>
        <rewrite>
            <globalRules>
                <rule name="ARR_myServerFarm_loadbalance" patternSyntax="Wildcard"
                stopProcessing="true">
                    <match url="*" />
                    <conditions>
                    </conditions>
                    <action type="Rewrite" url="http://myServerFarm/{R:0}" />
                </rule>
            </globalRules>
        </rewrite>
    </system.webServer>

    which rewrite all the site from another server.

    you need to add this rule at the server level.

    Refer below link for more detail:

    https://forums.iis.net/post/2156701.aspx

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Rovastar Rovastar

    5445 Posts

    MVP

    Moderator

    Re: Adding pools/sites for application with server farm

    Feb 13, 2020 05:29 PM|Rovastar|LINK

    You can have a many rules and farms you want. It all depends on your requirements.

    Normally I route traffic based on the host header (the domain name) for each site but you can do others, maybe a directory or for a certain IPs or user browser or something.

    Most of the time this will be an additional condition(s) the rewrite rule.

    The most important thing to get correct is the ordering of the rules otherwise it can get confusing about what it is routing too.

    Troubleshoot IIS in style
    https://www.leansentry.com/