Commit 7c187a2305e4c90f339ed5d7b79790bd04c9b601

Authored by Jacob Vosmaer
1 parent c6942ddb

Bring nginx config up to date with upstream

Upstream:
https://gitlab.com/gitlab-org/gitlab-ce/blob/636ec6d3a048957b5cb348d7ff1b0b5bc6973bbf/lib/support/nginx/gitlab
files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
... ... @@ -63,6 +63,10 @@ server {
63 63 # if a file, which is not found in the root folder is requested,
64 64 # then the proxy pass the request to the upsteam (gitlab unicorn)
65 65 location @gitlab {
  66 + # If you use https make sure you disable gzip compression
  67 + # to be safe against BREACH attack
  68 + <%= 'gzip off;' if @https %>
  69 +
66 70 proxy_read_timeout 300; # Some requests take more than 30 seconds.
67 71 proxy_connect_timeout 300; # Some requests take more than 30 seconds.
68 72 proxy_redirect off;
... ... @@ -75,5 +79,16 @@ server {
75 79 proxy_pass http://gitlab;
76 80 }
77 81  
  82 + # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
  83 + # WARNING: If you are using relative urls do remove the block below
  84 + # See config/application.rb under "Relative url support" for the list of
  85 + # other files that need to be changed for relative url support
  86 + location ~ ^/(assets)/ {
  87 + root /home/git/gitlab/public;
  88 + gzip_static on; # to serve pre-gzipped version
  89 + expires max;
  90 + add_header Cache-Control public;
  91 + }
  92 +
78 93 error_page 502 /502.html;
79 94 }
... ...