[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: nginx: hydra.gnu.org: Preserve 'Cache-Control' on narinfo respons
From: |
Ludovic Courtès |
Subject: |
01/01: nginx: hydra.gnu.org: Preserve 'Cache-Control' on narinfo responses. |
Date: |
Thu, 20 Apr 2017 05:48:45 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit 5e49ee21d5f9ffd67bef32360c835b9904687517
Author: Ludovic Courtès <address@hidden>
Date: Thu Apr 20 11:11:00 2017 +0200
nginx: hydra.gnu.org: Preserve 'Cache-Control' on narinfo responses.
Fixes a regression introduced in
c23811e87f100787966c9535dfbcf53f46510e82 where nginx would swallow
'Cache-Control' headers, and thus clients would be left without any
expiration time information.
* hydra/nginx/hydra.gnu.org-locations.conf: Add 'proxy_pass_header'
directive for .narinfo.
---
hydra/nginx/hydra.gnu.org-locations.conf | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hydra/nginx/hydra.gnu.org-locations.conf
b/hydra/nginx/hydra.gnu.org-locations.conf
index f8ffe21..ef446f9 100644
--- a/hydra/nginx/hydra.gnu.org-locations.conf
+++ b/hydra/nginx/hydra.gnu.org-locations.conf
@@ -113,9 +113,7 @@ location ~ /(nix-cache-info|static|logo|favicon\.ico) {
location ~ \.narinfo$ {
# Narinfos served by 'guix publish' (see above). If we change the
- # port to 3000, then they are served by Hydra. We assume that
- # 'guix publish --ttl' produces a 'Cache-Control' header for use
- # by 'guix substitute', so no need for nginx's 'expire' directive.
+ # port to 3000, then they are served by Hydra.
proxy_pass http://127.0.0.1:9999;
# For HTTP pipelining. This has a dramatic impact on performance.
@@ -138,6 +136,12 @@ location ~ \.narinfo$ {
proxy_cache_valid 504 2m; # timeout, when hydra.gnu.org is overloaded
proxy_cache_valid any 1m; # cache misses/others for 1 min.
+ # 'guix publish --ttl' produces a 'Cache-Control' header for use
+ # by 'guix substitute'. Let it through rather than use nginx's
+ # "expire" directive since the expiration time defined by 'guix
+ # publish' is the right one.
+ proxy_pass_header Cache-Control;
+
proxy_ignore_client_abort on;
# We need to hide and ignore the Set-Cookie header