summaryrefslogtreecommitdiff
path: root/lib/support/nginx/gitlab
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-03-24 14:59:09 +0100
committerMarin Jankovski <marin@gitlab.com>2014-03-24 14:59:09 +0100
commit8af94ed75505f0253823b9b2d44320fecea5b5fb (patch)
tree57d8c34ff2950ad154e6bbb83916c9fdaf9c0e4c /lib/support/nginx/gitlab
parente0bddb64da0d0c2b68cae779dbc4a4bbd49565e6 (diff)
downloadgitlab-ce-8af94ed75505f0253823b9b2d44320fecea5b5fb.tar.gz
Add gzip compression for assets to nginx example.
Diffstat (limited to 'lib/support/nginx/gitlab')
-rw-r--r--lib/support/nginx/gitlab8
1 files changed, 8 insertions, 0 deletions
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;
}