Fix the NGINX configuration for GitLab Pages with Cache-Control headers

This commit is contained in:
Nick Thomas 2017-08-08 13:37:13 +01:00
parent f353d5470d
commit 2242884e4f
1 changed files with 13 additions and 0 deletions

View File

@ -70,6 +70,19 @@ server {
proxy_set_header <%= header[0] %> <%= header[1] %>;
<% end %>
# Prevent NGINX from caching pages in response to the pages `Cache-Control`
# header.
#
# Browsers already respect this directive and Pages can handle the request
# volume without help from NGINX.
#
# If this changes in the future, ensure `proxy_cache_key` is set to a value
# like `$scheme$host$request_uri`, as the default value does not take the
# Pages hostname into account, leading to incorrect responses being served.
#
# See https://gitlab.com/gitlab-org/gitlab-pages/issues/73
proxy_cache off;
proxy_pass http://<%= @pages_listen_proxy %>;
}