Use NGINX proxy caching

This commit is contained in:
Jacob Vosmaer 2016-03-07 16:58:12 +01:00
parent 8f6f66a73c
commit 8b91c071e8
2 changed files with 8 additions and 0 deletions

View File

@ -456,6 +456,11 @@ default['gitlab']['nginx']['proxy_set_headers'] = {
"X-Forwarded-For" => "$proxy_add_x_forwarded_for"
}
# Cache up to 1GB of HTTP responses from GitLab on disk
default['gitlab']['nginx']['proxy_cache_path'] = 'proxy_cache keys_zone=gitlab:10m max_size=1g levels=1:2'
# Set to 'off' to disable proxy caching.
default['gitlab']['nginx']['proxy_cache'] = 'gitlab'
###
# Logging

View File

@ -32,6 +32,9 @@ http {
include /opt/gitlab/embedded/conf/mime.types;
proxy_cache_path <%= @proxy_cache_path %>;
proxy_cache <%= @proxy_cache %>;
<% if @gitlab_http_config %>
include <%= @gitlab_http_config %>;
<% end %>