From 8af94ed75505f0253823b9b2d44320fecea5b5fb Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 24 Mar 2014 14:59:09 +0100 Subject: Add gzip compression for assets to nginx example. --- lib/support/nginx/gitlab | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/support') diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index 7a0f3efbb53..5bff362da0e 100644 --- a/lib/support/nginx/gitlab +++ b/lib/support/nginx/gitlab @@ -54,6 +54,14 @@ server { proxy_pass http://gitlab; } + # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression + location ~ ^/(assets)/ { + root /home/git/gitlab/public; + gzip_static on; # to serve pre-gzipped version + expires max; + add_header Cache-Control public; + } + error_page 502 /502.html; } -- cgit v1.2.3