title: NGINX GZIP in ssl server block
body: <p>Since I added the gzip block to my NGINX conf, the page returns a 404 for most static files (.js, .css, .png etc.) and <code>was blocked because of a disallowed MIME type (“text/html”)</code> for the vue build files while in server:80 block.</p>
  <p>The files do have <code>content-encoding: gzip</code> response header</p>
  <p>nginx.conf</p>
  <pre><code>server {
      listen 80;
      server_name *.domain.dev;
  
      rewrite ^ https://$host$request_uri permanent;
  }
  
  server {
      listen [::]:443 ssl http2;
      listen      443 ssl http2;
      server_name *.domain.dev;
  
      location /static {
          gzip on;
          gzip_min_length 256;
          gzip_buffers 4 32k;
          gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
          gzip_vary on;
          gzip_comp_level 6;
          alias /home/ubuntu/code/domain_test/static;
          expires 1y;
      }
  
      //... rest of config
  }
  </code></pre>
  <p>If I move the GZIP block to the server:443 config, it works. Is the gzip block supposed to be in the ssl block, because of the redirect?</p>