Opened 9 years ago

Closed 9 years ago

#835 closed defect (worksforme)

Gzip module doesn't handle application/javascript mime type.

Reported by: maurocolella@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.6.x
Keywords: Cc:
uname -a: Linux xxx 4.1.5-x86_64-linode61 #7 SMP Mon Aug 24 13:46:31 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.6.2 (Ubuntu)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module

Description

See this thread for a description of the problem:

http://stackoverflow.com/questions/23939722/nginx-gzip-not-compressing-javascript-files/33777895#33777895

... the best-supported, old standard mime type for javascript in the browser is actually text/javascript. And if you configure that, in /etc/nginx/mime.types, it works.

So the gzip module of nginx is simply built against previous standards, and apparently doesn't properly process the application/javascript mime type.

Change History (1)

comment:1 by Valentin V. Bartenev, 9 years ago

Resolution: worksforme
Status: newclosed

Please, check the gzip_types directive in your configuration.
Reference: http://nginx.org/r/gzip_types

Note: See TracTickets for help on using tickets.