# 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 ``` Replace `[JAZUI_TOKEN]` with your token. The address sent to Jazui starts with `https://`: if your site runs on `http`, change it in `HTTP_X_JAZUI_URL`. ## What it does - The **Jazui** rule checks the user agent and `_escaped_fragment_` in a single pattern, the method, the `X-Jazui` header and that the path isn't a file. - It writes `Authorization`, `X-Jazui-Url` and `X-Jazui-Client-IP` as server variables and rewrites the request to `https://api.jazui.com/Render`, which ARR resolves as a proxy. - The **SPA** rule sends everything that isn't a file or folder to `index.html`. ## Keeping the bot list up to date This configuration has the bot list written inside it, between the `BOTS:BEGIN` and `BOTS:END` markers, because the server can't download it on its own. When Jazui adds new bots: 1. In the dashboard, go to **Websites** and click **Site token** on any of your sites. 2. Under **Bots in nginx, IIS and Apache**, choose your server's tab and copy the block. You'll see how many bots it has and the list date. 3. Replace everything between `BOTS:BEGIN` and `BOTS:END` in your configuration with that block and reload the server. You can also download the list as text with `GET https://api.jazui.com/v2/bots.txt` or the ready-made blocks with `GET https://api.jazui.com/v2/bots/config`. ##

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.