Welcome! Log In Create A New Profile

Advanced

Setting Gzip comression on Nginx

Posted by fopgames 
Setting Gzip comression on Nginx
July 05, 2012 12:01AM
Hi guys, I am having trouble setting Gzip on on nginx, I have the below code on my .conf file

Code:
gzip on;
gzip_min_length 1000;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth any;
gzip_comp_level 9;
gzip_types text/css text/plain text/xml application/xml application/xml+rss text/javascript application/x-javascript;
gzip_vary on;
gzip_disable "msie6";

this code is not causing any errors, so I assume it is working properly.But the problem is that it is not enabling caching on the browsers. Interestingly on the documentation page (http://wiki.nginx.org/HttpGzipModule) they say Content-Length header is not set when using gzip_http_version, and for gzip_min_length they say "Length is determined from the "Content-Length" header" and when i checked headers content-length wasn't there. but some minimum length seems to be required for compression

So my question is How do I set content-length header or how do I get nginx to compress files even without it

please Help me out guys, thanks
Re: Setting Gzip comression on Nginx
July 05, 2012 11:46PM
Problem seems to be solved now, I was using expires header as well as gzip header; so expires was serving old cache, than the new gzipped cache; cleared all the cache on my browser and it is now zipping as well as uses cache
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 227
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready