From 8af94ed75505f0253823b9b2d44320fecea5b5fb Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 24 Mar 2014 14:59:09 +0100 Subject: [PATCH] Add gzip compression for assets to nginx example. --- lib/support/nginx/gitlab | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index 7a0f3ef..5bff362 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; } -- libgit2 0.21.2