Skip to content

Instantly share code, notes, and snippets.

@joarhal
Created April 29, 2015 11:09
Show Gist options
  • Save joarhal/4b9df4add1c157942cf9 to your computer and use it in GitHub Desktop.
Save joarhal/4b9df4add1c157942cf9 to your computer and use it in GitHub Desktop.
iis sites web.config for unity3d webgl games
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 2" enabled="true" stopProcessing="true">
<match url="(.*)Release(.*)\.data" ignoreCase="true" />
<action type="Rewrite" url="{R:1}Compressed{R:2}.datagz" />
<conditions>
</conditions>
</rule>
<rule name="Imported Rule 1" enabled="true" stopProcessing="true">
<match url="(.*)Release(.*)\.js" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" ignoreCase="true" />
</conditions>
<action type="Rewrite" url="{R:1}Compressed{R:2}.jsgz" />
</rule>
<rule name="Imported Rule 3" enabled="true" stopProcessing="true">
<match url="(.*)Release(.*)\.mem" ignoreCase="true" />
<action type="Rewrite" url="{R:1}Compressed{R:2}.memgz" />
<conditions>
</conditions>
</rule>
<rule name="Imported Rule 4" enabled="true" stopProcessing="true">
<match url="(.*)Release(.*)\.unity3d" ignoreCase="true" />
<action type="Rewrite" url="{R:1}Compressed{R:2}.unity3dgz" />
<conditions>
</conditions>
</rule>
</rules>
<outboundRules>
<rule name="Rewrite JSGZ header" preCondition="IsJSGZ" stopProcessing="false">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<rule name="Rewrite MemGZ header" preCondition="IsMemGZ" stopProcessing="false">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<rule name="Rewrite DataGZ header" preCondition="IsDataGZ" stopProcessing="false">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<rule name="Rewrite Unity3DGZ header" preCondition="IsUnity3DGZ" stopProcessing="true">
<match serverVariable="RESPONSE_Content_Encoding" pattern=".*" />
<action type="Rewrite" value="gzip" />
</rule>
<preConditions>
<preCondition name="IsJSGZ">
<add input="{PATH_INFO}" pattern="\.jsgz$" />
</preCondition>
<preCondition name="IsMemGZ">
<add input="{PATH_INFO}" pattern="\.memgz$" />
</preCondition>
<preCondition name="IsDataGZ">
<add input="{PATH_INFO}" pattern="\.datagz$" />
</preCondition>
<preCondition name="IsUnity3DGZ">
<add input="{PATH_INFO}" pattern="\.unity3dgz$" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<staticContent>
<remove fileExtension=".unity3d" />
<mimeMap fileExtension=".unity3d" mimeType="application/vnd.unity" />
<mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
<mimeMap fileExtension=".data" mimeType="application/octet-stream" />
<mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
<mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
</staticContent>
<urlCompression doStaticCompression="true" doDynamicCompression="false" />
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment