Still Receiving Gzip Compression Message after Nginx Configuration
I have read the documentation at https://docs.unity3d.com/Manual/webgl-deploying.html.
And using that documentation I set up an Apache server to serve the Unity WebGL files in my project so that this message "You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression.", would stop displaying in my browser's console.
But adding .unityweb to the gzip configuration in my Nginx server will still show me the same message.
My question is what is the correct configuration to serve Unity Webgl files from a Nginx web server?
Thank you for your help.
Answer by eonjnoland · Jul 27, 2018 at 11:30 PM
Found this thread which works for a single default site with no static directory configuration.
https://forum.unity.com/threads/configure-nginx-to-serve-unityweb-with-gzip-header.524529/
For a more complicated setup dealing with static files I used this configuration and it worked for me. Add this to your server block for a specific site /etc/nginx/sites-available/default
for a example.
location ~* ^/static/.*\.unityweb$ { root /var/www/html; add_header Content-Encoding gzip; }