This is interesting because the best, old standard mime type for javascript in the browser is actually text / javascript. And if you configure this, in /etc/nginx/mime.types it works.
text / javascript (Deprecated): JavaScript; Defined and deprecated in RFC 4329 to discourage its use in favor of the application / javascript. However, / javascript text is allowed in HTML 4 and 5 and, unlike the / javascript application, supports cross-browser. The "type" attribute of a tag in HTML5 is optional and should not be used at all, since all browsers always accepted the correct default values (even in HTML 4, where this was required by the specification).
From this topic: text / javascript vs application / javascript
Thus, the nginx gzip module is simply built against previous standards and apparently does not correctly handle the mime type of the application / javascript.
Argo Nov 18 '15 at 10:43 2015-11-18 10:43
source share