# IIS
> A URL Rewrite rule with ARR in your IIS site's web.config.
Source page: https://docs.jazui.com/integrations/iis/en
On IIS, a **URL Rewrite** rule recognizes bots and, with **Application Request Routing** (ARR) as a proxy, serves them Jazui's page. If your application is ASP.NET Core, it's simpler and more robust to use the [ASP.NET Core package](https://docs.jazui.com/llms/en/integrations-aspnetcore.txt).
## Before you start
- The **URL Rewrite** and **Application Request Routing** modules installed (from Microsoft's IIS website).
- Your site **verified before enabling the rule**: with ARR, if Jazui answers with an error, the bot gets that error.
- Your token.
## Installation
Open a console as administrator and run these two commands. The first enables ARR's proxy; the second lets the rule write the headers Jazui needs:
`cmd`:
```bash
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy /enabled:"True" /commit:apphost
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/rewrite/allowedServerVariables /+"[name='HTTP_AUTHORIZATION']" /+"[name='HTTP_X_JAZUI_URL']" /+"[name='HTTP_X_JAZUI_CLIENT_IP']" /+"[name='HTTP_COOKIE']" /commit:apphost
```
Then put this `web.config` in your site's folder (or copy its two rules into your existing one, Jazui's before the SPA's):
`web.config` (https://docs.jazui.com/example_config/iis_web.xml):
```xml
Request your home page as if you were a bot, with the test user agent integration-test:
curl -I -A "integration-test" https://mysite.com/
The response must include x-jazui: true, with x-jazui-cache: MISS the first time and HIT afterwards. Without a bot user agent (curl -I https://mysite.com/) you should get your usual website, without x-jazui. In the dashboard, the request shows up in Bot traffic and the page in Cached pages.
Request your home page as if you were a bot, with the test user agent `integration-test`: ``` curl -I -A "integration-test" https://mysite.com/ ``` The response must include `x-jazui: true`, with `x-jazui-cache: MISS` the first time and `HIT` afterwards. Without a bot user agent (`curl -I https://mysite.com/`) you should get your usual website, without `x-jazui`. In the dashboard, the request shows up in **Bot traffic** and the page in **Cached pages**. ## If something doesn't work - **Error 500.50 or «server variable not allowed»**: the second command (allowed variables) is missing. - **404 or 502.3 when requesting as a bot**: ARR's proxy isn't enabled (first command) or the server can't reach the Internet on port 443. - **Behind Cloudflare**, `{REMOTE_ADDR}` is the CDN's IP: use `{HTTP_CF_CONNECTING_IP}` (or `{HTTP_X_FORWARDED_FOR}`) in `HTTP_X_JAZUI_CLIENT_IP`. - The maximum wait is ARR's proxy timeout (server settings, **Application Request Routing Cache › Server Proxy Settings › Time-out**); 20 seconds is a good value.