How to Set Up Application Request Routing (ARR) with IIS on Windows Server 2025
Application Request Routing (ARR) is a Microsoft IIS extension that transforms a standard web server into a powerful HTTP load balancer and reverse proxy. On Windows Server 2025, ARR is the recommended approach for distributing traffic across multiple backend web servers, implementing SSL offloading, enabling session affinity for stateful applications, and caching frequently requested content at the proxy tier. This guide covers the complete ARR setup process — from installation and server farm creation through load balancing algorithm selection, health monitoring, and disk-based caching.
Prerequisites
- Windows Server 2025 with IIS 10 and the URL Rewrite Module installed (ARR depends on it)
- At least two backend web servers reachable over the network from the ARR server
- Administrator privileges and PowerShell 5.1 or later
- Web Platform Installer (WebPI) or direct MSI download access
- An SSL certificate bound to the ARR server if using SSL offloading
Step 1: Install Application Request Routing
ARR is not included in Windows Server 2025 by default and must be installed as an IIS extension. The recommended installation method uses the WebPI command-line tool:
# Install ARR 3.0 via Web Platform Installer CLI
WebpiCmd-x64.exe /Install /Products:"ARR" /AcceptEula /SuppressPostFinish
Alternatively, download the ARR MSI directly and install silently:
$arrUrl = "https://download.microsoft.com/download/A/A/3/AA3AD04A-EFAF-4781-9784-5916-70A30E1DEA3E/ARRv3_setup_amd64_en-us.exe"
$dest = "$env:TEMPARRv3_setup.exe"
Invoke-WebRequest -Uri $arrUrl -OutFile $dest
Start-Process -FilePath $dest -ArgumentList "/quiet" -Wait
iisreset /noforce
After installation, the Application Request Routing Cache node will appear under the server in IIS Manager.
Step 2: Enable the ARR Proxy
ARR’s proxy capability must be explicitly enabled before it can forward any requests. Open IIS Manager, click the server node, open Application Request Routing Cache, then click Server Proxy Settings in the Actions pane and check Enable proxy. To do this via PowerShell:
Import-Module WebAdministration
# Enable ARR proxy at the server level
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "system.webServer/proxy" `
-Name "enabled" `
-Value $true
Write-Host "ARR proxy enabled."
Step 3: Create a Server Farm
A server farm is ARR’s grouping of backend servers. You can create one via IIS Manager (right-click Server Farms → Create Server Farm) or PowerShell. The PowerShell approach is repeatable and scriptable:
$farmName = "MyWebFarm"
# Create the server farm
Add-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms" `
-Name "." `
-Value @{ name = $farmName }
Write-Host "Server farm '$farmName' created."
Step 4: Add Backend Web Servers to the Farm
Add each backend server to the farm. Replace the IP addresses and ports with your actual backend nodes:
$farmName = "MyWebFarm"
$backends = @(
@{ address = "192.168.10.11"; httpPort = 80 },
@{ address = "192.168.10.12"; httpPort = 80 },
@{ address = "192.168.10.13"; httpPort = 80 }
)
foreach ($backend in $backends) {
Add-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='$farmName']/servers" `
-Name "." `
-Value @{
address = $backend.address
"applicationRequestRouting.httpPort" = $backend.httpPort
}
Write-Host "Added backend: $($backend.address):$($backend.httpPort)"
}
Step 5: Configure Health Tests
ARR continuously monitors backend server health and removes unavailable nodes from rotation. Configure a URL-based health test:
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting/healthCheck" `
-Name "url" `
-Value "http://192.168.10.11/health.html"
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting/healthCheck" `
-Name "interval" `
-Value "00:00:30" # Check every 30 seconds
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting/healthCheck" `
-Name "responseMatch" `
-Value "healthy" # Body must contain this string
Create a lightweight health.html on each backend containing the text healthy. ARR marks a server offline if the health check fails three consecutive times and returns it to the pool when it succeeds again.
Step 6: Configure Load Balancing Algorithms
ARR supports several load balancing algorithms. The two most widely used are Weighted Round Robin and Least Response Time:
# Weighted Round Robin (default) — distribute evenly unless weights differ
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting" `
-Name "loadBalancingAlgorithm" `
-Value "WeightedRoundRobin"
# Least Response Time — route to the fastest responding server
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting" `
-Name "loadBalancingAlgorithm" `
-Value "LeastResponseTime"
To assign different weights to servers (useful when backends have different hardware capacities), set the weight property per server node in applicationHost.config. A server with weight 2 receives twice the traffic of a server with weight 1.
Step 7: Create URL Rewrite Rules to Route Traffic to the Farm
ARR routing is implemented through URL Rewrite rules. When IIS Manager creates a server farm, it automatically adds a routing rule to the site’s web.config. You can also define this manually:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ARR Route to Farm" stopProcessing="true">
<match url="^(.*)" />
<action type="Rewrite"
url="http://MyWebFarm/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
This rule rewrites every incoming request to the server farm, which ARR intercepts and forwards to a backend node according to the configured load balancing algorithm.
Step 8: Enable Session Affinity (Sticky Sessions)
Stateful applications that store session data locally on each backend require that each client always routes to the same server. ARR implements session affinity via an ARRAffinity cookie:
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting" `
-Name "affinity.useCookie" `
-Value $true
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "webFarms/webFarm[@name='MyWebFarm']/applicationRequestRouting" `
-Name "affinity.cookieName" `
-Value "ARRAffinity"
On the first request, ARR sets the ARRAffinity cookie with a value encoding the selected backend. Subsequent requests with that cookie are always forwarded to the same server. Note: mark the cookie SameSite=None; Secure if clients use HTTPS — ARR handles this automatically when SSL offloading is active.
Step 9: Configure SSL Offloading
With SSL offloading, the ARR server terminates HTTPS connections and forwards plain HTTP to the backends, reducing CPU load on each node. Bind your SSL certificate to the ARR site in IIS, then ensure backend servers listen on HTTP only (port 80). ARR sets the X-Forwarded-Proto: https header so backends can detect the original protocol:
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "system.webServer/proxy" `
-Name "reverseRewriteHostInResponseHeaders" `
-Value $false
# Instruct ARR to preserve original Host header
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "system.webServer/proxy" `
-Name "preserveHostHeader" `
-Value $true
Configure your backend applications to trust the X-Forwarded-Proto header when determining whether a request arrived over HTTPS.
Step 10: Enable ARR Disk Cache
ARR can cache responses from backends on the proxy’s local disk, dramatically reducing backend load for cacheable content such as static assets and API responses with appropriate Cache-Control headers:
# Enable disk caching and set cache location
Set-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "system.webServer/diskCache/locations/add[@path='D:\ARRCache']" `
-Name "maxUsage" `
-Value 10240 # 10 GB
Add-WebConfigurationProperty `
-PSPath "MACHINE/WEBROOT/APPHOST" `
-Filter "system.webServer/diskCache/locations" `
-Name "." `
-Value @{ path = "D:ARRCache"; maxUsage = 10240; enabled = $true }
Only responses with a public Cache-Control directive and no Authorization header are cached. Use Vary headers carefully — an overly broad Vary: * header disables caching entirely.
Application Request Routing on Windows Server 2025 gives your IIS infrastructure enterprise-grade load balancing, health monitoring, and SSL offloading without requiring third-party software. By building on the URL Rewrite foundation, ARR integrates cleanly into your existing IIS configuration management workflow. Start with a basic round-robin farm, validate health check behavior by taking one backend offline, then enable session affinity and disk caching as your traffic patterns demand. The combination of ARR and IIS creates a resilient, scalable front end capable of handling thousands of concurrent connections while shielding your application backends from direct internet exposure.