Add gzip compression for assets to nginx example.

This commit is contained in:
Marin Jankovski 2014-03-24 14:59:09 +01:00
parent e0bddb64da
commit 8af94ed755
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}