IIS ARR Loadbalancer always hits top URL rewrite rule

336 views Asked by At

I have a public IP mapped to my router and 3 servers in LAN connected to the Router. 1st Server is ARR LoadBalancer and 2nd and 3rd Servers are hosted with a Website on port 80. Doing port forwarding on router for port 80 to ARR LoadBalance Server.

I have selected Load Balance Algorithm as: Weighted Round Robin, and Load distribution as Even distribution on both the Server Farms.

Always the top URL Rewrite is hit, the load is not distributed in RoundRobin fashion.

I have written URL Rewrite as below: gc80 is ServerFarm for Server1. gc2_80 is ServerFarm for Server2.

<rewrite>
            <globalRules>
                <clear />                
                <rule name="PublicIP_to_Server1_80" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="PublicIPHere*" />
                    </conditions>
                    <action type="Rewrite" url="http://gc80/{R:0}" />
                </rule>
                <rule name="PublicIP_to_Server2_80" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="PublicIPHere*" />
                    </conditions>
                    <action type="Rewrite" url="http://gc2_80/{R:0}" />
                </rule>                
            </globalRules>
        </rewrite>
        <proxy enabled="true" />

Please let me know if i am missing anything for LoadBalancing?

0

There are 0 answers