Reverse Proxy with ARR
IIS can be the front door for apps that run their own web server — Node.js on port 3000, a Java app on 8080 — adding HTTPS, logging and one public address.
On this page · 5 min · Advanced
On this page
- Learning objectives
- Explanation
- Step-by-step screens
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Advanced
- Updated
- Nov 26, 2026
Related tutorials
Interview questions
Learning objectives#
- Enable the ARR proxy
- Create a reverse proxy rule
- Preserve the host header and client IP
- Proxy only one path
Explanation#
Install URL Rewrite and Application Request Routing (ARR). Then on the server node: Application Request Routing Cache → Server Proxy Settings → tick Enable proxy → Apply. Nothing is proxied until this is on.
On the site: URL Rewrite → Add Rule(s) → Reverse Proxy. Enter localhost:3000 and IIS writes a rewrite rule to http://localhost:3000/{R:1}. Tick “Enable SSL Offloading” so the back end receives plain HTTP while visitors use HTTPS.
The back end sees requests coming from IIS. ARR adds X-Forwarded-For with the client IP; set preserveHostHeader so the app sees the original Host. Configure the app to trust these headers (for Express: app.set('trust proxy', 1)).
A pattern such as ^api/(.*) proxies only /api to the back end while IIS serves the rest (for example a React build) itself.
Step-by-step screens#
Drawings of IIS Manager in IIS 10 (Windows Server 2019/2022, Windows 10/11). The red numbers match the numbered actions under each picture; names on your computer will differ.
Loading pictures…
Code example: Proxy /api to a Node.js server#
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Proxy API to Node" stopProcessing="true">
<match url="^api/(.*)" />
<action type="Rewrite" url="http://localhost:3000/api/{R:1}" />
<serverVariables>
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
<!-- once per server (run in an elevated prompt):
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy /enabled:"True" /preserveHostHeader:"True" /commit:apphost
-->
https://shop.example/api/products is answered by the Node.js app on port 3000; everything else is served from the site folder by IIS.
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- The rule matches only URLs starting with api/.
- Rewrite (not Redirect) forwards the request internally.
- X-Forwarded-Proto tells the app the visitor used HTTPS (add the variable to the allowed server variables list first).
- appcmd enables the proxy and keeps the original Host header.
Real-world use case#
A team on Windows Server runs a Node.js API and a React front end on one domain: IIS serves the React files, handles the certificate, and proxies /api to Node.
Common mistakes#
IIS returns 404 for the proxied path. Enable proxy in Server Proxy Settings.
IIS returns 500.50. Add them under URL Rewrite → View Server Variables first.
Best practices#
- Proxy only what needs it
- Terminate HTTPS at IIS
- Forward client IP and protocol
- Keep the back end listening on localhost only
Remember this#
ARR → Server Proxy Settings → Enable proxy.
Rewrite to http://localhost:port/{R:1}.
X-Forwarded-For = real client IP.
Practice exercise#
Your task: Write the rewrite action that forwards everything to http://localhost:8080.
Show solution
<action type="Rewrite" url="http://localhost:8080/{R:1}" />
Mini quiz#
Which IIS modules are needed for a reverse proxy?
Want more? Practise all IIS MCQs · IIS interview questions
My notes#
Saved in this browser.