I’ve recently unearthed an old Unity project from 2016 (made with 5.3.4f1, and incompatible with the latest versions…) and decided to re-export it in WebGL and put it on my website.
It worked well in localhost. But when deployed on my website, this error was raised by UnityLoader.js :
Some old threads mentioned it was due to decompressing errors, so I followed the manual : Unity - Manual: Server configuration code samples
and since the three compressed files in the /Release/ folder are .memgz, .jsgz ans .datagz, I added this to my nginx.conf :
You’re right for noticing it, but perhaps the syntax is just different in your later version.
I had copypasted these lines from the index.html exported by Unity, so I guess that’s how it’s supposed to be written. In fact changing them to “.datagz” / “.memgz” / “.jsgz” makes it not work even in localhost…
I finally fixed it, by exporting it a later version (2020.1.8f1), old enough so the project could still be opened, but recent enough so it has the “Enable decompression fallback” option. It can be checked in WebGL Player Settings > Publishing Settings.
Now it works !