Problem with serving gzip and br compressed build in my aws cloudfront nginx server.(Unity Bug)

From AWS premium service they told me to contact with unity to solve this problem since the origin is not compressing the files(WebGL build)/there is a bug. So i get these messages according to the Content Encoding and my build doesn’t load. I see people have the same problem here ( WebGL build doesn't load in browser ) but they can not solve it. Please, engineers from Unity or everyone else try to give a hand! Thank you!


Before going further, does the app work when compression is disabled? If so, I highly suggest you look at AWS support forums / stackoverflow and other nginx support mediums.

Although it might be Unity-related, everything points to server configuration from my perspective. Look at keywords such as “nginx aws brotli configuration”. If all fails, maybe look at switching to gzip.

Might get lucky and get a good samaritain to help you out on this forum but your best bet for quicker resolution is server config troubleshooting, not Unity.

Hello KamilDA! So yes when compression is disabled everything works fine! I have talked with almost 10 technical aws engineers on 1 on 1 videocalls but still they can not figure out the problem and they believe that it’s a problem from the side of Unity.

See this screenshot! I added the nginx server with brottli support and i fixed the content encoding but still i get the error message!
6922376--812135--problem.png

I went on https://www.instahome360.com/tour_brottli/ but it doesn’t appear to have the project there.

Can you confirm which version of Unity you’re using?

So, right from the get go, you’re missing: “Content-Encoding: gzip” from your response headers on your .gz files.

That’s not a Unity issue, it’s a server config issue. I get you’re frustrated but you need your server to send that response header.

I attached an example of a working gzip build served from Azure’s Blob Storage as reference.

Also, I highly recommend you use a more stable version from 2020.x as the beta can bring its own share of issues.


The thing is that with 2019 i don’t have mobile support so i want at least 2020 version for sure.

Also i tried static website hosting in asure and aws and still the same errors on version 2020 and 2021(beta)

Link doesn’t work.

  • Can you confirm that you are building an empty-ish Unity project (v2020.1+) to test the server configs?
  • Can you confirm you’re using the template from 2020 (complete build with default html launcher, not just replacing the .gz / js / data files).

Edit: @Steven_Damian I just saw your other thread. Seem like indeed it was a server config issue and not a Unity issue. If you can permit me to do give some advise: Please edit previous-posts with extra details instead of new posts if its within a few minutes. This is a forum, not instant messaging. Additionally, please edit your original posts with the solution you found for everyone to know. Right now, going though your post / topic history, in some of those (not all) we don’t know what you did to fix your issue and one might still think it’s an Unity issue when it’s actually a server config issue.

1 Like

Yes exactly. So the solution was that my .htaccess files are not allowed by default in aws ec2 servers. So you should set Allow Override: All (instead of None)