Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Nginx config for gzipping static assets.

  • Loading branch information...
commit 5c21bcad9da0157cc4457afead1514bb3f1a65c0 1 parent 6897580
@pwnall authored
Showing with 10 additions and 0 deletions.
  1. +2 −0  CHANGELOG
  2. +8 −0 lib/rails_pwnerer/app/nginx_config.rb
View
2  CHANGELOG
@@ -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.
View
8 lib/rails_pwnerer/app/nginx_config.rb
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.