0
votes

My current setup is as following: Apache -> Nginx -> Varnish running on Ubuntu

apache2.conf: h**p://pastebin.com/A3wehAbe

.htaccess: h**p://pastebin.com/Yre4hdSy (edited to allow deflate)

nginx.conf: h**p://pastebin.com/6X59CTAr (gzip enabled)

varnish: default settings

My problem is, it seems that GZIP only works with html content, not css or js.

I tested GZIP with this tool at: http://www.gidnetwork.com/tools/gzip-test.php

  1. h**p://rentsites.com.au result: compressed yes

    status HTTP/1.1 200 OK server nginx/0.7.65 content-type text/html; charset=UTF-8 x-powered-by PHP/5.3.2-1ubuntu4.22 x-pingback h**p://rentsites.com.au/xmlrpc.php vary Accept-Encoding content-encoding gzip content-length 2281 accept-ranges bytes date Mon, 13 Jan 201400:50:26 GMT x-varnish 785049695 785049694 age 13 via 1.1 varnish connection close

  2. h**p://rentsites.com.au/wp-includes/js/jquery/jquery.js result: compressed NO

    status HTTP/1.1 200 OK server nginx/0.7.65 content-type application/x-javascript last-modified Wed, 21 Aug 2013 15:41:10 GMT expires Mon, 12 Jan 2015 23:17:22 GMT cache-control max-age=31536000, public pragma public content-length 93085 accept-ranges bytes date Mon, 13 Jan 2014 00:27:30 GMT x-varnish 785049693 785049631 age 4208 via 1.1 varnish connection close

  3. h**p://rentsites.com.au/wp-content/themes/twentyfourteen/genericons/genericons.css result: compressed NO

    status HTTP/1.1 200 OK server nginx/0.7.65 content-type text/css last-modified Tue, 12 Nov 2013 18:38:10 GMT expires Mon, 12 Jan 2015 23:16:50 GMT cache-control max-age=31536000, public pragma public content-length 22680 accept-ranges bytes date Mon, 13 Jan 2014 00:52:38 GMT x-varnish 785049696 785049621 age 5748 via 1.1 varnish connection close

Please help. Thanks for reading.

1
you didn't share the 1 config file that actually matters, the virtual host file, I would assume yours exist inside /etc/nginx/sites-enabled is there a file other than default? if not then please share default, because I don't think wordpress would work without special virtual host settingsMohammad AbuShady
Please don't duplicate your questions on serverfault and stackoverflow. Duplicate: serverfault.com/questions/566807/…NITEMAN
@MohammadAbuShady: here's the content of 'example': pastebin.com/1521fcRrALAN VO
Ok I just noticed that the gzip is enabled on the http block of nginx.conf, so I think this might be varnish's fault, but I can't tell for sure if it supports gzip by default or notMohammad AbuShady
Varnish only does caching, I dont think it has anything to do with gzip.ALAN VO

1 Answers

0
votes

Turns out that we need to add this to .htaccess:

AddType text/css .css AddType text/javascript .js