November 21, 2015 13:12 by
rasmus
When publishing Unity 5.x WebGL content on a ASP.NET web server, you will see following error when opening your game in a browser, if your webserver hasn't been configured correctly:
An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
uncaught exception: incorrect header check
This is caused by server returning HTTP 403 error messages on the file extensions used by Unity WebGL. Create or update Web.config file in root of your website to contain following entries:
<configuration>
<system.webServer>
<staticContent>
<!-- Unity 5.x -->
<mimeMap fileExtension=".data" mimeType="application/binary" />
<mimeMap fileExtension=".mem" mimeType="application/binary" />
<!-- Unity 5.3 -->
<mimeMap fileExtension=".datagz" mimeType="application/binary" />
<mimeMap fileExtension=".jsgz" mimeType="application/binary" />
<mimeMap fileExtension=".memgz" mimeType="application/binary" />
</staticContent>
</system.webServer>
</configuration>
d6a47318-c9e5-4730-b23a-c2158567a76b|2|5.0