How to enable .unityweb GZIP in NGNIX on ubuntu?

Hi, I saw
“You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression.”
In my code, I also found:

on the topic.

Unfortunately I’m quite new to webhosting so, how to do this with ngnix?
Thank you!

I tried following:

in /etc/nginx/nginx.conf I added:
gzip on;
gzip_disable “msie6”;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

how to add unitywebin the types???

Then I also read somewhere to add:

location ~ .+.unityweb$ {
add_header Content-Encoding gzip;
}

to the server in ngnix config.
But when I do that, I get a 404 when trying to request the .unityweb

the file is located in:
https://www.myhost.com/assets/3d/box_000.data.unityweb

1 Like

I have same error

on my case

location ~ .+.unityweb$ {
root /YourRoot/RootFoloder; #this is very important if you have location root
add_header Content-Encoding gzip;
add_header Content-Type application/octet-stream;
}

resolve!