Permalink
Browse files

Nginx config for gzipping static assets.

  • Loading branch information...
1 parent 6897580 commit 5c21bcad9da0157cc4457afead1514bb3f1a65c0 @pwnall committed Sep 8, 2011
Showing with 10 additions and 0 deletions.
  1. +2 −0 CHANGELOG
  2. +8 −0 lib/rails_pwnerer/app/nginx_config.rb
View
@@ -1,3 +1,5 @@
+v0.6.100. Nginx configuration for Rails 3.1 asset pipeline.
+
v0.6.99. Reinstall gems when restoring an app from backup.
v0.6.98. Fixed various crashes when restoring a backup.
@@ -39,6 +39,14 @@ def config_nginx(app_name, instance_name)
#{(dns_names.empty? ? '' : "server_name " + dns_names.join(' ') + ";")}
root #{app_config[:app_path]}/public;
client_max_body_size #{app_config[:max_request_mb]}M;
+ location ~* ^/assets/ {
+ gzip_static on;
+ expires max;
+ add_header Cache-Control public;
+ break;
+ }
+ error_page 404 /404.html;
+ error_page 500 502 503 504 /500.html;
location / {
if (-f $request_filename) {
expires max;

0 comments on commit 5c21bca

Please sign in to comment.