Answer the question
In order to leave comments, you need to log in
How to force Nginx to distribute zipped static?
Good time. Built nginx with http_gzip_static_module, nginx -V shows:
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-mail --with-mail_ssl_module
--with-file-aio --with-http_spdy_module
--with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wp,-D_FORTIFY_SOURCE=2'
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed'
--with-ipv6
location / {
gzip_static on;
root /var/www;
index index.html;
}
Answer the question
In order to leave comments, you need to log in
I strongly suspect that either it is necessary gzip_static always;
, or the non-zip file should lie side by side.
By the way, are you sure that this is exactly what you need, and not compression "on the fly" of uncompressed static stored on disk? There's not much overhead is obtained.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question