<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="api" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*api/*" />
                    <action type="Rewrite" url="https://izzt.jt-sky.com/api/{R:2}" />
                    <serverVariables>
                        <set name="HTTP_X_ORIGINAL_HOST" value="{HTTP_HOST}" />
                    </serverVariables>
                </rule>
                <rule name="hubs" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*hubs/*" />
                    <action type="Rewrite" url="https://izzt.jt-sky.com/hubs/{R:2}" />
                </rule>
                <rule name="index" enabled="true" stopProcessing="true">
                    <match url="^((?!(api)).)*$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
