Open paynecodes opened 10 years ago
I had to set the following rules:
http {
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 512;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml image/svg+xml;
looks like --with-http_gzip_static_module wasn't included when compiling nginx binary (see http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html)
I came across this buildpack mostly due the fact that I wanted to GZip my assets. I figured nginx would be good for this (as well as the reasons listed in your README).
Anyways, I added the default
nginx.conf.erb
to myconfig
folder. Then I attempted adding the following from the Asset Pipeline Guide to theserver
section like this:I get an application error. Here's the most important part from the logs:
Of course,
/path/to/public
is just placeholder, so, as a side note, I'm wondering if this will work:Moving forward, it seems that nginx needs to be configured with
http_gzip_static_module
. I'm not exactly sure how to do that or if it fits in the scope of this repo.Does anyone have any experience with trying to GZip precompiled assets using nginx? Better way? Am I on to something we could merge in with this repo? This module seems to be configurable in other, less popular build packs I've seen around here on GitHub.
Also, this method is documented here using Passenger: http://dennisreimann.de/blog/configuring-nginx-for-the-asset-pipeline/