2

I'm having trouble serving a large (376kb) javascript file via nginx over ssl with gzip enabled. The file is served without issue over plain old http.

The file in question is ckeditor.js and is located at https://www.myleadconverter.com/js/lib/ckeditor/ckeditor.js

I've searched around and all I've found is some information on gzip_buffers. Everything I've found seems to link back to http://blog.leetsoft.com/2007/07/25/nginx-gzip-ssl.html

The relevant bits from my nginx.conf:

gzip                    on;
gzip_comp_level         5;
gzip_proxied            any;
gzip_buffers            16 8k;
gzip_types              text/plain text/css application/x-javascript text/xml
                        application/xml application/xml+rss text/javascript;
gzip_disable            "MSIE [1-6]\.(?!.*SV1)";
gzip_vary               on;

Currently, the download is stopping at 105kb but should be 119kb compressed (this info is from dev tools in chrome). If I use wget and supply the accept-encoding header, it will eventually load but only after resuming the download several times:

mac2:Desktop andrewmullins$ wget -S --header="accept-encoding: gzip" https://www.myleadconverter.com/js/lib/ckeditor/ckeditor.js
--2013-02-26 00:30:04--  https://www.myleadconverter.com/js/lib/ckeditor/ckeditor.js
Resolving www.myleadconverter.com... 184.106.67.181
Connecting to www.myleadconverter.com|184.106.67.181|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Server: nginx/0.8.54
  Date: Tue, 26 Feb 2013 06:31:39 GMT
  Content-Type: application/x-javascript
  Connection: keep-alive
  Vary: Accept-Encoding
  Accept-Ranges: bytes
  Content-Length: 375761
  Last-Modified: Tue, 18 Dec 2012 04:08:08 GMT
Length: 375761 (367K) [application/x-javascript]
Saving to: `ckeditor.js'

21% [====================>                                                                               ] 81,681      16.2K/s   in 4.9s    

2013-02-26 00:30:11 (16.2 KB/s) - Connection closed at byte 81681. Retrying.

Any ideas on what settings to change to get the download to complete over ssl?

  • Knowing nothing about it, I would hazard a guess that your buffer is too small. Have you tried upping that to say 512k? – Grizly Feb 26 '13 at 10:11
  • Do you use any 3rd-party modules? Why do you use such an ancient version of nginx? `gzip_buffers` has nothing to do with your problem. – VBart Feb 26 '13 at 18:02
  • There's no particular reason for being on an old version. I suppose I could go ahead and update it when we spin up a new server. Let it be said that I am NOT a "server guy", I'm a web developer who's been roped into managing a server. I can provide additional nginx config information, if necessary - it may help to see how we've configured ssl and how we're passing requests to jetty. – Andrew Mullins Feb 26 '13 at 22:52

0 Answers0