Commit 36ea864504854558c0dd3f626177a638022c312d

Authored by Dmitriy Zaporozhets
2 parents ad7277df 8af94ed7

Merge branch 'enable_assets_compression' into 'master'

Add gzip compression for assets to nginx example
Showing 1 changed file with 8 additions and 0 deletions   Show diff stats
lib/support/nginx/gitlab
@@ -54,6 +54,14 @@ server { @@ -54,6 +54,14 @@ server {
54 proxy_pass http://gitlab; 54 proxy_pass http://gitlab;
55 } 55 }
56 56
  57 + # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
  58 + location ~ ^/(assets)/ {
  59 + root /home/git/gitlab/public;
  60 + gzip_static on; # to serve pre-gzipped version
  61 + expires max;
  62 + add_header Cache-Control public;
  63 + }
  64 +
57 error_page 502 /502.html; 65 error_page 502 /502.html;
58 } 66 }
59 67